Ravindra BagaleCourses & study guides Track your progress

Excel IF Function

Chala mitrano — today IF. Ask a yes/no question; Excel picks answer A or answer B.

Fictional sample data for learning. Pass/fail marks in Nashik coaching + Chicago online tests. Mixed ₹ and $ fees.

Purpose

Return one value if a test is TRUE, another if FALSE.

Return value

The value_if_true or value_if_false you supply.

Syntax

IF(logical_test, value_if_true, [value_if_false])

Arguments

ArgumentRequired?Description
logical_testRequiredA test that is TRUE or FALSE (example B2>=35).
value_if_trueRequiredResult when the test passes.
value_if_falseOptionalResult when it fails (blank if omitted).

Version

All Excel versions. LibreOffice Calc and Google Sheets too.

How to use — Why → What → How

Why: Reports need Pass/Fail, Due/OK, High/Low — not a human scanning every row. Pass/fail marks in Nashik coaching + Chicago online tests. Mixed ₹ and $ fees. In Indian back offices and foreign sister teams, IF shows up on approval, SLA and fee sheets every week.

What: IF runs logical_test. If TRUE it returns value_if_true; else value_if_false. Read every argument in the table once before you type; each one changes the answer on purpose.

How — numbered steps:

  1. Type =IF(B2>=35,"Pass","Fail").
  2. Fill down.
  3. Nest carefully or prefer IFS for many branches.

Ravindra Bagale's Tip

Friends, after IF, find one IF/logic cell in a real workbook this week that this lesson improves.

Ravindra Bagale's Tip

Friends, sleep on IF; rebuild example 1 tomorrow without looking.

Ravindra Bagale's Tip

Friends, say the business rule in plain words before =IF.

Ravindra Bagale's Tip

Friends, after you finish IF, open yesterday’s real workbook and find one place this function would have saved ten minutes.

Ravindra Bagale's Tip

Friends, treat IF like a seatbelt on logic columns — use it before a manager asks why the flag is wrong.

Download practice file: practice-if.xlsx (includes sheet About this data, practice sheets, and Answers).

Worked examples

1) Pass mark

Nashik test.

NameScore
Neha Shah42
Amit Patil28
Formula: =IF(B2>=35,"Pass","Fail")

Result: Pass

What it means: 42 ≥ 35 → Pass (row2 would Fail).

2) Fee due

Chicago $.

PaidFee $
No120
Formula: =IF(A2="No","Due","Cleared")

Result: Due

What it means: Text test with quotes.

3) Bonus ₹

Sales.

Sales ₹
85000
Formula: =IF(A2>=80000,5000,0)

Result: 5000

What it means: Numeric threshold.

4) Nested band

Grade.

Score
78
Formula: =IF(A2>=75,"A",IF(A2>=60,"B","C"))

Result: A

What it means: Nested IF — consider IFS.

5) Blank safe

Empty score.

Score
Formula: =IF(A2="","Enter score",IF(A2>=35,"Pass","Fail"))

Result: Enter score

What it means: Guard blanks first.

6) AND inside IF

Both city and status.

CityStatus₹
PuneOpen900
Formula: =IF(AND(A2="Pune",B2="Open"),"Review","Skip")

Result: Review

What it means: Combine tests with AND.

About this data. Small demo rows for learning. Real sheets are longer; the same formula pattern scales when columns are clean.

Common errors and fixes

#VALUE! — Bad test types. Fix: Compare like with like.
Always one branch — Test never TRUE. Fix: Check spellings/spaces — TRIM.
Nested spaghetti — Too many IFs. Fix: Use IFS/SWITCH.

Notes and tips

  • Revisit IF errors after the quiz.
  • Build one example from memory.
  • Check types if results look wrong.
  • Teach a tip in Marathi or Hindi.
  • Keep currency consistent in one column (practice mixes ₹ $ £ €).
  • Drill: build Pass/Fail and Due flags on a mixed Pune/Chicago sheet from memory.
  • IF vs IFS: one test vs many sequential tests.
  • Fictional sample data only.
  • Print the IF revision card.
  • Ask juniors to predict before Enter.
  • Track your top mistake monthly.
  • Pass/fail marks in Nashik coaching + Chicago online tests. Mixed ₹ and $ fees.
  • Logical tests love TRIM and UPPER when text is messy.
  • Interview tip: explain the business rule before the formula.
  • When nesting, keep each IF on its own mental line — or switch to IFS/SWITCH.
  • Classroom drill: invent three brand-new formulas from your city without the page open.
  • Share one tip with a classmate — teaching locks the idea.
  • If a result looks wrong, check blanks vs zeros before rewriting logic.
  • Print the revision card for IF for one week of real worksheets.
  • When helping a junior, ask them to predict before Enter.
  • Share one tip with a classmate in Marathi or Hindi.
  • Keep currency symbols consistent inside a single report column.
  • When Excel versions differ, write a nested-IF fallback under IFS/SWITCH in a comment.
  • Logical tests love TRIM and UPPER when text is messy.
  • Interview tip: explain the business rule before the formula.

In real work

Drill: build Pass/Fail and Due flags on a mixed Pune/Chicago sheet from memory. Pass/fail marks in Nashik coaching + Chicago online tests. Mixed ₹ and $ fees. Classroom drill: write three brand-new IF formulas on a blank sheet using names from your own city — if you can invent them without the page open, you own the skill. Then break one formula on purpose and watch the error; recovering from that break is half of interview readiness. Always verify with a known case before trusting a long chain of logical tests. Keep a personal notebook of the one mistake you make most often with this function; review it monthly.

How it compares

IF vs IFS: one test vs many sequential tests.

Interview corner

IF vs IFS?
Two-way vs many tests.
Text tests?
Quotes + TRIM.
Nesting limit pain?
Move to IFS.

IFS, IFERROR, AND, OR, SWITCH

Practice tasks (10)

  1. Task 1. Pass/Fail on score ≥35.
    IF.
  2. Task 2. Due if Paid=No.
    Text.
  3. Task 3. Bonus if sales≥80000.
    Number.
  4. Task 4. Nested A/B/C.
    Nest.
  5. Task 5. Blank message.
    Guard.
  6. Task 6. AND inside IF.
    AND.
  7. Task 7. Explain vs IFS.
    Interview.
  8. Task 8. TRIM before text test.
    Spaces.
  9. Task 9. Fill down 10 rows.
    Fill.
  10. Task 10. Bonus: IFERROR wrap later.
    Related.

Quick quiz

Q1. IF needs at least:
Q2. Text in tests needs:
Q3. Many branches prefer:
Q4. Blank guard:
Q5. IF returns:

Answers: Q1=A logical test, Q2=Quotes, Q3=IFS, Q4=IF(A2="","…",…), Q5=Your chosen values (check after you try).

Revision card

Standalone card (no tip or photo strip). QR opens this lesson. Download the PNG and revise offline.

Revision card: IF
IF revision card