|
Home > Formulas > Logical > Topics Excel Logical Functions GuideA short guide to the Excel logical functions, including IF, IFS, IFERROR, AND, OR, TRUE, FALSE and more. Some logical functions, such as LAMBBDA, LET and MAKEARRAY, are only available in Excel 365 or Excel for the Web. Authors: Debra Dalgleish |

The Excel IF function is helpful if you want to check something on a worksheet, then show result A or B. This short video shows the steps for setting up a simple IF formula. There are written steps on the IF function page.
Video Timeline
In this formula, there are two IF functions, with one nested inside the other.
=IF(C7="","", IF(D7="","", C7*D7)

Click the link to read more about the IF function, and see other examples, and get a download file.
In Excel 2016 and later, there is also an IFS function, which you can use instead of multiple nested IF functions. With the IFS function:
In this example, instead of using a nested IF formula, I used an IFS formula in column E.
=IFS(COUNTA(B9:D9)=3, C9*D9, B9="","", C9="","no price", D9="","no qty")
The formula checks 3 cells in an order form, to see if these cells have values entered:

Click the link to read more about the IFS function, and see other examples, and get a download file.
the IFERROR and IFNA functions check the results of a calculation. If the result is an error, the value that you specify is returned instead of that error.
In this example, I used IFERROR with the SEARCH function, to prevent a #VALUE! error from showing in cell D5.
=IFERROR(SEARCH(B5,B2),"Not Found")
The SEARCH function checks cell B2, to see if it contains the text that I typed in cell B5.

Use the AND and OR functions to combine 2 or more tests, such as column B contains "Paid" and column D contains "Shipped".
You can combine AND and OR functions with other Excel functions, such as IF function..
This example shows AND combined in a formula with IF.
=IF(AND(B4="Paid",D4="Shipped"),"Completed","Pending")

This example shows the difference between OR and XOR. Both formulas check the Status and Amt cells, to see if they are empty.

Click the link to read more about the AND function, and see other examples, and get a download file.
The following logical functions are also available, depending on which Excel version you're using.
Note: The links go to each function's Help page on the Microsoft website.
| Function | Added | Description |
| NOT | Reverses the logic of its argument | |
| TRUE | Returns the logical value TRUE | |
| FALSE | Returns the logical value FALSE | |
| SWITCH | 2016 | Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned. |
| BYCOL | 365 | Applies a LAMBDA to each column and returns an array of the results |
| BYROW | 365 | Applies a LAMBDA to each row and returns an array of the results |
| LAMBDA | 365 | Create custom, reusable functions and call them by a friendly name |
| LET | 365 | Assigns names to calculation results |
| MAKEARRAY | 365 | Returns a calculated array of a specified row and column size, by applying a LAMBDA |
| MAP | 365 | Returns an array formed by mapping each value in the array(s) to a new value by applying a LAMBDA to create a new value |
| REDUCE | 365 | Reduces an array to an accumulated value by applying a LAMBDA to each value and returning the total value in the accumulator |
| SCAN | 365 | Scans an array by applying a LAMBDA to each value and returns an array that has each intermediate value |
Last updated: July 8, 2025 3:46 PM