Lesson 1.2 – Logical Functions (IF, AND, OR, IFERROR)
1. What Are Logical Functions?
Logical functions in Excel are used to test conditions and return specific results based on whether the condition is TRUE or FALSE.
They are very useful for decision-making and dynamic reporting.
A. IF Function
Purpose – Checks a condition and returns one value if TRUE and another if FALSE.
Syntax:
Example:
If A1 is 50 or more, it shows Pass, otherwise Fail.
B. AND Function
Purpose – Returns TRUE if all conditions are TRUE.
Syntax:
Example:
Returns TRUE only if both A1 and B1 are 50 or more.
C. OR Function
Purpose – Returns TRUE if any condition is TRUE.
Syntax:
Example:
Returns TRUE if either A1 or B1 is 50 or more.
D. IFERROR Function
Purpose – Returns a custom value if a formula results in an error; otherwise returns the result of the formula.
Syntax:
Example:
If B1 is zero, it shows the custom error message instead of an Excel error.
Real-Life Example – Combining Logical Functions
Here:
-
Pass only if both subjects have marks ≥ 50.
-
Otherwise, Fail.
Best Practices for Logical Functions
-
Use nested IF for multiple conditions, but keep them readable.
-
Use AND/OR inside IF for complex conditions.
-
Always handle possible errors using IFERROR.
Practice Questions – Lesson 1.2
-
Write an IF formula to check if cell A1 contains a value greater than 100, and return “High” or “Low”.
-
Which logical function will return TRUE if both conditions are correct?
-
Write a formula using OR that checks if A1 is “Yes” or B1 is greater than 500.
-
How can IFERROR improve your formulas?
-
True or False: IF function can only test one condition.
