Logical functions help Excel make decisions.
Think of them like asking a question:
"If this condition is true, do this. Otherwise, do something else."
1️⃣ What Are Logical Functions?
Logical functions test whether something is:
They are used when you want Excel to:
2️⃣ The IF Function (Most Important Logical Function)
🔹 What IF Does
It checks a condition and returns one value if TRUE and another if FALSE.
🔹 Syntax
=IF(logical_test, value_if_true, value_if_false)
🔹 Example 1: Pass or Fail
Dataset
| Student | Score | |---------|-------| | John | 75 | | Mary | 45 | | David | 60 | | Anna | 30 |
Rule:
Formula:
=IF(B2>=50,"Pass","Fail")
Result
| Student | Score | Result | |---------|-------|--------| | John | 75 | Pass | | Mary | 45 | Fail | | David | 60 | Pass | | Anna | 30 | Fail |
3️⃣ Logical Operators (Used Inside IF)
| Operator | Meaning | |----------|-----------------------| | = | Equal to | | > | Greater than | | < | Less than | | >= | Greater than or equal | | <= | Less than or equal | | <> | Not equal |
4️⃣ Nested IF (Multiple Conditions)
Sometimes you need more than two outcomes.
Example: Grading System
Rules:
Dataset
| Student | Score | |---------|-------| | John | 85 | | Mary | 67 | | David | 45 | | Anna | 92 |
Formula:
=IF(B2>=80,"Distinction",IF(B2>=50,"Pass","Fail"))
Result
| Student | Score | Grade | |---------|-------|-------------| | John | 85 | Distinction | | Mary | 67 | Pass | | David | 45 | Fail | | Anna | 92 | Distinction |
5️⃣ AND Function
🔹 What It Does
Returns TRUE only if ALL conditions are true.
🔹 Syntax
=AND(condition1, condition2, ...)
🔹 Example
Rule:
Dataset
| Student | Score | Attendance | |---------|-------|------------| | John | 75 | 80% | | Mary | 60 | 60% | | David | 45 | 90% | | Anna | 85 | 95% |
Formula
=IF(AND(B2>=50,C2>=75),"Pass","Fail")
Result
| Student | Score | Attendance | Result | |---------|-------|------------|--------| | John | 75 | 80% | Pass | | Mary | 60 | 60% | Fail | | David | 45 | 90% | Fail | | Anna | 85 | 95% | Pass |
6️⃣ OR Function
🔹 What It Does
Returns TRUE if at least one condition is true.
🔹 Syntax
=OR(condition1, condition2, ...)
Example
Rule:
=IF(OR(B2>=8000,C2>=5),"Bonus","No Bonus")
7️⃣ NOT Function
🔹 What It Does
Reverses TRUE/FALSE.
If TRUE → FALSE
If FALSE → TRUE
=NOT(A2>50)
8️⃣ TRUE and FALSE Functions
Excel has built-in logical values:
=TRUE() =FALSE()
Usually used in advanced formulas.
9️⃣ Real Business Example
Sales Performance
| Employee | Sales | Target | |----------|-------|--------| | John | 9000 | 8000 | | Mary | 7000 | 8000 | | David | 8500 | 8000 | | Anna | 6000 | 8000 |
Formula
=IF(B2>=C2,"Target Met","Target Not Met")
Result
| Employee | Sales | Target | Status | |----------|-------|--------|----------------| | John | 9000 | 8000 | Target Met | | Mary | 7000 | 8000 | Target Not Met | | David | 8500 | 8000 | Target Met | | Anna | 6000 | 8000 | Target Not Met |
🔟 Why Logical Functions Are Important
They allow you to:
Without logical functions, Excel would only calculate — not decide.