IF Statements
Make Excel think and decide for you
IF Statements
The IF function lets Excel make decisions for you.
Think about it like this:
In daily life: "If it is raining, take umbrella. If not, do not take umbrella."
In Excel: "If the score is above 60, show Pass. If not, show Fail."
The IF Formula
=IF(condition, yes_result, no_result)

It has 3 parts:
| Part | What It Means | Example |
|---|---|---|
| condition | The question you are asking | A1>60 |
| yes_result | What to show if answer is YES | Pass |
| no_result | What to show if answer is NO | Fail |
Your First IF Formula
Problem: Check if a student passed (score above 60).
Cell A1 has the score: 75
Formula: =IF(A1>60, "Pass", "Fail")
What Excel does:
- Is 75 greater than 60? YES
- So show: Pass

Practice: Pass or Fail
EasyIf score in A1 is greater than 60, show "Pass". Otherwise show "Fail".
Another Example
Problem: Check if we need to order more items (quantity below 10).
Cell A1 has quantity: 5
Formula: =IF(A1<10, "Order More", "OK")
What Excel does:
- Is 5 less than 10? YES
- So show: Order More
Practice: Check Stock
EasyIf quantity in A1 is less than 10, show "Order More". Otherwise show "OK".
Comparison Symbols
| Symbol | Meaning | Example |
|---|---|---|
| > | Greater than | A1>60 |
| < | Less than | A1<10 |
| = | Equal to | A1=100 |
| >= | Greater than or equal | A1>=60 |
| <= | Less than or equal | A1<=50 |
| <> | Not equal to | A1<>0 |
Checking Text
You can also check text values. Put the text in quotes.
Example: Check if payment status is "Paid".
=IF(A1="Paid", "Done", "Pending")
If A1 contains "Paid", it shows "Done". Otherwise, it shows "Pending".
Practice: Check Payment
EasyIf A1 equals "Paid", show "Done". Otherwise show "Pending".
Doing Math in IF
You can do calculations in the result.
Example: Give 10% discount if purchase is over 100.
=IF(A1>100, A1*0.9, A1)
If A1 is 150:
- Is 150 greater than 100? YES
- So calculate: 150 * 0.9 = 135
Practice: Calculate Discount
EasyIf A1 is greater than 100, multiply A1 by 0.9 (10% off). Otherwise just show A1.
Multiple Conditions (Nested IF)
Sometimes you need to check more than two options.
Example: Assign grades based on score.
- 90 or above = A
- 70 or above = B
- Below 70 = C
=IF(A1>=90, "A", IF(A1>=70, "B", "C"))
How it works:
- First check: Is score >= 90? If yes, show "A"
- If no, check: Is score >= 70? If yes, show "B"
- If no, show "C"

Practice: Assign Grade
EasyIf A1>=90 show "A". If A1>=70 show "B". Otherwise show "C".
Common Mistakes
Mistake 1: Forgot quotes around text
Wrong: =IF(A1>60, Pass, Fail)
Right: =IF(A1>60, "Pass", "Fail")
Mistake 2: Forgot comma between parts
Wrong: =IF(A1>60 "Pass" "Fail")
Right: =IF(A1>60, "Pass", "Fail")
Summary
- IF lets Excel make decisions
- Formula:
=IF(condition, yes_result, no_result) - Always put text in quotes: "Pass"
- Use symbols: >, <, =, >=, <=, <>
- You can nest IF inside IF for multiple conditions
IF is one of the most useful functions in Excel. Practice it until it becomes natural.