IF practice exercises (with answers)

Fifteen IF and IFS problems—pass/fail flags, nested bands, AND/OR, and IFERROR—plus links into live drills.

Use the grade sheet below in A1:C8. Write answers in column E. Companion overview: IF, IFS, or SWITCH. Live drill: IF Function. Guides: IF, IFS.

The practice table

StudentScoreRetake
Ada92No
Bob67Yes
Chen74No
Dia58Yes
Eli81No
Fay45No
Gia70Yes

Refresher

=IF(logical_test, value_if_true, value_if_false)
=IFS(test1, value1, test2, value2, …)

Exercise 1 — pass/fail

In E2, Pass if Score ≥ 60 else Fail for Ada.

Answer: =IF(B2>=60, "Pass", "Fail") → Pass

Exercise 2 — fill-down

Copy exercise 1 from E2 to E8. Confirm Fay is Fail and Gia is Pass.

Exercise 3 — eligibility

Eligible if Score ≥ 70 and Retake is No.

Answer in E2: =IF(AND(B2>=70, C2="No"), "Eligible", "No") → Eligible for Ada

Exercise 4 — OR recovery

Flag “Needs help” if Score is under 60 or Retake is Yes.

Answer: =IF(OR(B2<60, C2="Yes"), "Needs help", "OK")

Exercise 5 — nested band

Return High (≥85), Mid (≥70), else Low for Ada.

Answer: =IF(B2>=85, "High", IF(B2>=70, "Mid", "Low")) → High

Exercise 6 — IFS grades

Letter grade: A≥90, B≥80, C≥70, D≥60, else F.

Answer: =IFS(B2>=90,"A", B2>=80,"B", B2>=70,"C", B2>=60,"D", TRUE,"F")

Exercise 7 — missing catch-all

What happens if you omit the final TRUE,"F" and Score is 40?

Answer: #N/A from IFS — always finish with a catch-all.

Exercise 8 — blank score

If B2 is blank, show Missing instead of grading.

Answer: =IF(B2="", "Missing", IF(B2>=60, "Pass", "Fail"))

Exercise 9 — IFERROR wrap

Someone nests a VLOOKUP inside IF. Prefer IFERROR for missing keys—see VLOOKUP practice.

Answer pattern: =IFERROR(VLOOKUP(...), "Not found")

Exercise 10 — text vs number

Score stored as text "74". Does >=70 still work?

Answer: Excel often coerces, but clean with VALUE or proper number format when results look random.

Exercise 11 — SWITCH codes

Map Retake Yes→1, No→0 with SWITCH.

Answer: =SWITCH(C2, "Yes", 1, "No", 0, "—")

Exercise 12 — interview

When is IFS clearer than nested IF?

Answer: three or more ordered thresholds (grades, commissions). Nested IF is fine for two outcomes.

Exercise 13 — COUNTIF combo

Count how many students Pass (Score ≥ 60) with COUNTIF—compare to COUNTIF practice.

Answer: =COUNTIF($B$2:$B$8, ">=60") → 6

Exercise 14 — absolute criteria

Put pass mark 60 in $G$1. Rewrite exercise 1 using the cell.

Answer: =IF(B2>=$G$1, "Pass", "Fail")

Exercise 15 — live drill

Open IF Function, then browse the practice hub.

Check your work

  1. IF guide
  2. IFS guide
  3. Short companion: IF, IFS, or SWITCH

Excel practice hub · Free lessons · Blog