## Excel Office

Excel How Tos, Tutorials, Tips & Tricks, Shortcuts

# Category: Logical Functions

Excel Logical Functions check the data and return the result «TRUE» if the condition is true, and «FALSE» if not.

## AND function: Description, Usage, Syntax, Examples and Explanation

What is AND function in Excel? AND function is one of the Logical functions in Microsoft Excel that is used to determine if all conditions in a test are TRUE. Examples of AND function Here are some general examples of using AND by itself, and in conjunction with the IF function. Formula Description =AND(A2>1,A2<100) Displays TRUE if A2 is greater than 1 AND less than 100, otherwise it…

## NOT function: Description, Usage, Syntax, Examples and Explanation

What is NOT function in Excel? NOT function is one of the Logical functions in Microsoft Excel that is used when you want to make sure one value is not equal to another. Examples of NOT function Examples Here are some general examples of using NOT by itself, and in conjunction with IF, AND and OR. Formula Description =NOT(A2>100) A2 is NOT greater than 100 =IF(AND(NOT(A2>1),NOT(A2<100)),A2,”The value is out of…

## SWITCH function: Description, Usage, Syntax, Examples and Explanation

What is SWITCH function in Excel? SWITCH function is one of the Logical functions in Microsoft Excel that evaluates one value (called the 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. Syntax of SWITCH function In its simplest form, the SWITCH function says:…

## OR function: Description, Usage, Syntax, Examples and Explanation

What is OR function in Excel? OR function is one of the Logical functions in Microsoft Excel that determines if any conditions in a test are TRUE. Illustration of OR function Example Here are some general examples of using OR by itself, and in conjunction with IF. Formula Description =OR(A2>1,A2<100) Displays TRUE if A2 is greater than 1 OR less than 100, otherwise it displays FALSE. =IF(OR(A2>1,A2<100),A3,”The value…

## IFNA function: Description, Usage, Syntax, Examples and Explanation

What is IFNA function in Excel? IFNA function is one of the Logical functions in Microsoft Excel that returns the value you specify if the formula returns the #N/A error value; otherwise returns the result of the formula. Syntax of IFNA function IFNA(value, value_if_na) The IFNA function syntax has the following arguments. Value    Required. The argument that is checked for the…

## TRUE function: Description, Usage, Syntax, Examples and Explanation

What is TRUE function in Excel? TRUE function is one of the Logical functions in Microsoft Excel that returns the logical value TRUE. You can use this function when you want to return the value TRUE based on a condition. For example: =IF(A1=1,TRUE()) You can also enter the value TRUE directly into cells and formulas without using this function. For…

## XOR function: Description, Usage, Syntax, Examples and Explanation

What is XOR function in Excel? XOR function is one of the Logical functions in Microsoft Excel that returns a logical Exclusive Or of all arguments. Syntax of XOR function XOR(logical1, [logical2],…) The XOR function syntax has the following arguments. Logical1, logical2,…    Logical 1 is required, subsequent logical values are optional. 1 to 254 conditions you want to test that can…

## IFERROR function: Description, Usage, Syntax, Examples and Explanation

What is IFERROR function in Excel? IFERROR function is one of the Logical functions in Microsoft Excel that returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula. Use the IFERROR function to trap and handle errors in a formula. Syntax of IFERROR function IFERROR(value, value_if_error) The IFERROR function syntax has the…

## IFS function: Description, Usage, Syntax, Examples and Explanation

What is IFS function in Excel? IFS function is one of the Logical functions in Microsoft Excel that checks whether one or more conditions are met, and returns a value that corresponds to the first TRUE condition. IFS can take the place of multiple nested IF statements, and is much easier to read with multiple conditions. Syntax of IFS function Generally, the…

## FALSE function: Description, Usage, Syntax, Examples and Explanation

What is FALSE function in Excel? FALSE function is one of the Logical functions in Microsoft Excel that  returns the logical value FALSE. Syntax of FALSE function FALSE() The FALSE function syntax has no arguments. FALSE formula explanation You can also type the word FALSE directly onto the worksheet or into the formula, and Microsoft Excel interprets it as the logical…

## IF function: Description, Usage, Syntax, Examples and Explanation

What is IF function in Excel? IF function is one of logical functions in Microsoft Office Excel that returns one value if the condition is TRUE, or another value if the condition is FALSE. Syntax of IF function The syntax for the IF function in Microsoft Excel is: IF( condition, value_if_true, [value_if_false] ) IF formula explanation condition The value that you want to test.…

## Check multiple cells are equal in Excel

To confirm two ranges of the same size contain the same values, you can use a simple array formula based on the AND function. See illustration below: Formula {=AND(range1=range2)} Explanation In the example shown, the formula in C9 is: {=AND(B5:D12=F5:H12)} Note: this is an array formula and must be entered with control + shift + enter. How this formula works The AND…

## Return blank if in Excel

This tutorial shows how to calculate Return blank if in Excel using the example below; Formula =IF(A1=1,B1,””) Explanation To return a blank result using the IF function, you can use an empty string (“”).  In the example shown, the formula in D5 (copied down) is: =IF(B5=1,C5,””) How this formula works This formula is based on the IF function, configured with a simple logical…

## Nested IF function example in Excel

This tutorial shows how to calculate Nested IF function example in Excel using the example below; Formula =IF(T1,R1,IF(T2,R2,IF(T3,R3,IF(T4,R4,R5)))) Explanation In the code above, T1-T5 represents 5 different logical tests, and R1-R5 represents 5 different results. You can see that each IF function requires it’s own set of parentheses. This article describes the Excel nested IF construction. Usually, nested IFs are used when…

## Invoice status with nested if in Excel

This tutorial shows how to calculate Invoice status with nested if in Excel using the example below; Formula =IF(balance=0,”Paid”,IF(current_date<due_date,”Open”,”Overdue”)) Explanation To determine invoice status (i.e. paid, open, overdue), you can use a nested IF formula and the TODAY function. In the example shown, the formula in G5 is: =IF(F5=0,”Paid”,IF(TODAY()<C5,”Open”,”Overdue”)) How this formula works Note: the “current date” (i.e. today) for this example…

## IF with boolean logic in Excel

This tutorial shows how to calculate IF with boolean logic in Excel using the example below; Formula = IF(criteria1*criteria2*criteria3,result) Explanation In the example shown, the formula in F8 is: {=SUM(IF((color=”red”)*(region=”East”)*(quantity>7),quantity))} Note: this is an array formula, and must be entered with control + shift + enter. How this formula works Note: This example demonstrates how to replace a nested IF formula with a single IF…

## IF with wildcards in Excel

This tutorial shows how to calculate IF with wildcards in Excel using the example below; Formula =IF(COUNTIF(A1,”??-????-???”),””,”invalid”) Explanation The IF function doesn’t support wildcards, but you can combine IF with COUNTIF or COUNTIF to get basic wildcard functionality. In the example shown, the formula in C5 is: =IF(COUNTIF(B5,”??-????-???”),””,”invalid”) How this formula works Unlike several other frequently used functions, the IF function does not…

## Extract multiple matches into separate rows in Excel

This tutorial shows how to calculate Extract multiple matches into separate rows in Excel using the example below; Explanation To extract multiple matches to separate cells, in separate rows, you can use an array formula based on INDEX and SMALL. In the example shown, the formula in E5 is: {=IFERROR(INDEX(names,SMALL (IF(groups=E\$4,ROW(names)-MIN(ROW (names))+1),ROWS(\$E\$5:E5))),””)} This is an array formula and must be…

## How to use Excel FALSE Function

This Excel tutorial explains how to use the Excel FALSE function with syntax and examples. Excel FALSE Function Description The Excel False function returns the logical value FALSE. The function takes no arguments and therefore, the syntax is simply: FALSE() Note that you can also get the same result by simply typing the text ‘False’ into your worksheet. FALSE Function Example Syntax…

## How to use Excel XOR Function

This Excel tutorial explains how to use the XOR function with syntax and examples. Excel XOR Function Function Description Excel XOR function performs what is called “exclusive OR”. The XOR function returns the Exclusive Or logical operation for one or more supplied conditions. With two logical statements, XOR returns TRUE if either statement is TRUE, but returns FALSE if both statements are…

## How to use Excel TRUE Function

This Excel tutorial explains how to use the TRUE function with syntax and examples. Excel TRUE Function Description The Excel True function returns the logical value TRUE. The function takes no arguments and therefore, the syntax is simply: TRUE() Note that you can also get the same result by simply typing the text ‘True’ into your spreadsheet. TRUE Function Example…

## How to use Excel OR Function

This Excel tutorial explains how to use the  OR function with syntax and examples. Excel OR Function Description The Excel OR function tests a number of supplied conditions and  returns TRUE if any of the conditions are TRUE. Otherwise, it returns FALSE. That is; TRUE if ANY of the conditions evaluate to TRUE or FALSE otherwise (i.e. if ALL of the conditions evaluate to FALSE). Excel Or…

## How to use Excel AND Function

This Excel tutorial explains how to use the AND function with syntax and examples. Excel AND Function Description Microsoft Excel AND function tests a number of supplied conditions and returns TRUE if all conditions are TRUE. It returns FALSE if any of the conditions are FALSE. That is; TRUE if ALL of the conditions evaluate to TRUE or FALSE otherwise (i.e. if ANY of the conditions evaluate…

## How to use Excel NOT Function

This Excel tutorial explains how to use the NOT function with syntax and examples. Excel NOT Function Description The Excel NOT function returns the opposite to a supplied logical value. That is, If supplied with the value TRUE, the Not function returns FALSE; If supplied with the value FALSE, the Not function returns TRUE. Excel Not Function Examples The following…

## Complete List of Excel Logical Functions, References and Examples

Logic Functions in Excel check the data and return the result «TRUE» if the condition is true, and «FALSE» if not. Here’s a full list of Built-In Logical Functions in Excel and their Descriptions below: Click each of the function link to see detailed example. Boolean Operator Functions AND Tests a number of user-defined conditions and returns TRUE if ALL of the conditions evaluate to…

## OR function Examples in Excel

The OR function in Excel returns TRUE if any of the conditions are TRUE and returns FALSE if all conditions are false. Combine the OR function with other functions and become an Excel expert. 1. For example, take a look at the OR function in cell D2 below. Explanation: the OR function returns TRUE if the first score is greater than 70 or the…

## How to use IFS function in Excel

Use the IFS function in Excel 2016 when you have multiple conditions to meet. The IFS function returns a value corresponding to the first TRUE condition. Note: if you don’t have Excel 2016, you can nest the IF function. 1a. If the value in cell A1 equals 1, the IFS function returns Bad. 1b. If the value in cell A1 equals 2, the IFS function…

## SWITCH function example in Excel

Excel SWITCH function compares an expression to a list of values and returns the corresponding result. This example teaches you how to use the SWITCH function in Excel 2016 instead of the IFS function. 1a. For example, the IFS function below finds the correct states. Explanation: cell A2 contains the string 85-UT. The RIGHT function extracts the 2 rightmost characters from this string (UT).…

## How to return blank in place of #DIV/0! error in Excel

This example illustrates the IFERROR function and how to return blank in place of #DIV/0! error in Excel. 1. For example, Excel displays the #DIV/0! error when a formula tries to divide a number by 0. 2. Use the IFERROR function. If a cell contains an error, an empty string (“”) is displayed.

## Not Equal To ‘<>‘ operator in Excel

In Excel, <> means not equal to. The <> operator in Excel checks if two values are not equal to each other. Let’s take a look at a few examples. 1. The formula in cell C1 below returns TRUE because the text value in cell A1 is not equal to the text value in cell B1. 2. The formula in cell C1…

## Excel If, Nested If, And/Or Criteria Examples

IF function is one of the most used functions in Excel. This page contains many easy to follow IF examples. Simple If Examples The IF function checks whether a condition is met, and returns one value if true and another value if false. 1a. For example, take a look at the IF function in cell B2 below. Explanation: if the price is…

## IF, AND, OR and NOT Functions Examples in Excel

Learn how to use Excel’s logical functions such as the IF, AND, OR and NOT function. If The IF function checks whether a condition is met, and returns one value if true and another value if false. 1. For example, take a look at the IF function in cell C2 below. Above Case Study Explanation: if the score is greater than or…