The Logic function is one of Microsoft Excel's most popular and useful functions. The Logic function in Excel helps you check values and automatically execute work based on the test results. Here's everything you need to know about Logic functions in Excel .
- Microsoft Excel
- Microsoft Excel for Android
- Microsoft Excel for iOS
- Microsoft Excel Online
What is a Logic Function?
Logic Functions in Excel allow users to make decisions when implementing formulas and functions. Logic functions are often used to:
- Check the accuracy of the condition.
- Combine multiple conditions together.
What are conditions? Why is it important?
A condition is an expression that evaluates to true or false. This expression can be a function that determines the value entered into the cell as a number or text, a value greater than, equal to, or lower than a certain value...
Example of IF function in Excel
In this article we will take an example of a family shopping budget. The IF function is used here to decide whether the item value is expensive or not. Suppose goods with a value greater than 6,000 are expensive. Items priced lower than 6,000 are affordable. Please see the illustration below to understand better.
- Place the cursor in cell F4.
- Enter the formula using the following IF function: =IF(E4<>
Explain:
- "=IF(…)" is the IF function.
- "E4<> is the condition the IF function evaluates. It checks whether the value of cell E4 (Subtotal) is lower than 6,000 or not.
- "Yes" is the value that the function will display if the value of E4 is lower than 6,000.
- “No” is the value that the function will display if the value of E4 is greater than 6,000.
After completing the work, press the Enter key . You will receive the following results:
Explain the meaning of Logic functions in Excel
Jaw |
Describe |
Using |
AND |
Tests multiple conditions and returns True if all conditions are true. |
=AND(1 > 0,ISNUMBER(1))
The above function returns TRUE because both conditions are true.
|
FALSE |
Returns the logical value FALSE. It is used to compare the results of a condition or function for true or false results. |
FALSE() |
IF |
Verify whether the condition meets the requirements or not. If it is, it returns True. Otherwise, it returns False. =IF(logical_test,[value_if_true],[value_if_false]). |
=IF(ISNUMBER(22),"Yes", "No")
22 is the number for the function to return Yes.
|
IFERROR |
Returns the expression value if no error occurs. If there is an error, it returns the error value. |
=IFERROR(5/0,"Divide by zero error") |
IFNA |
Returns value if #N/A error does not occur. If there is a #N/A error, it returns the value NA. The #N/A error is an if value is not available for a formula or function. |
=IFNA(D6*E6,0). The above formula returns 0 if both cells D6 or E6 are empty. |
NOT |
Returns True if the condition is false and returns False if the condition is true. |
=NOT(ISTEXT(0))
The above function returns True
|
OR |
Used when evaluating multiple conditions. Returns true if all or any of the conditions are true. Returns false if all conditions are false. |
=OR(D8="admin",E8="cashier")
The above function returns True if both D8 and E8 are admin or cashier
|
TRUE |
Returns the logical value TRUE. It is used to compare the results of conditions or functions that return true or false. |
TRUE() |