IF function practice exercises (with AND, OR and IFS)
IF is the formula that makes decisions: pass or fail, over or under budget, yes or no. Practice IF on its own, then combine it with AND and OR, and finish with IFS for grading-style rules with several outcomes.
Try it yourself
A live spreadsheet. Type a formula and press Enter to check it.
Did Emma pass Math? The pass mark is 50. Return "Pass" or "Fail".
Write your formula in the green cell, H2.
Click a cell to add it to your formula, drag to select a range, or click a column letter for the whole column.
All 11 logic exercises
- 1→
Pass or fail
FreeDid Emma pass Math? The pass mark is 50. Return "Pass" or "Fail".
- 2→
Needs a retake
FreeIf Liam scored below 50 in Math, return "Retake". Otherwise return "OK".
- 3→
Attendance warning
PremiumReturn "Warning" if Ethan's attendance is below 75%, otherwise "OK".
- 4→
Strong in every subject
PremiumDid Olivia score 85 or more in all three subjects? Return TRUE or FALSE.
- 5→
IF that returns a number
PremiumAdd 5 bonus points to Liam's Science score if his attendance is 80% or more. Otherwise keep his score as it is.
- 6→
Flag students for support
PremiumReturn "Support" for Noah if any score is below 50 or attendance is under 90%. Otherwise return "On track".
- 7→
Average inside IF
PremiumReturn "Top of class" if Olivia's average across Math, English and Science is 90 or more. Otherwise return "-".
- 8→
Nested IF
PremiumGive Noah a Science band using nested IFs: "High" for 80+, "Mid" for 60 to 79, otherwise "Low".
- 9→
Letter grades
PremiumGive Mia a letter grade for Math: A for 85+, B for 70+, C for 50+, otherwise F.
- 10→
Add up TRUEs
PremiumDid Lucas score 80 or more in at least two subjects? Return TRUE or FALSE.
- 11→
AND with an average
PremiumReturn "Scholarship" if Mia averages 75 or more across her three subjects and her attendance is 90% or more. Otherwise return "No".
The logic functions, with examples
Every example runs on class-results.xlsx, the same sheet the exercises use, and the results are calculated from that data.
Checks a condition and returns one value if it's TRUE and another if it's FALSE.
IF(logical_test, value_if_true, [value_if_false])Example
=IF(B2>=50, "Pass", "Fail")returnsPassAND
Full guide →Returns TRUE only when every condition is TRUE. Usually used inside IF.
AND(logical1, [logical2], …)Example
=AND(B3>=50, C3>=50)returnsFALSEReturns TRUE when at least one condition is TRUE.
OR(logical1, [logical2], …)Example
=OR(B3<50, C3<50, D3<50)returnsTRUEIFS
Full guide →Tests conditions in order and returns the value for the first one that's TRUE. Cleaner than nesting several IFs, for example for grade bands.
IFS(logical_test1, value_if_true1, …)Example
=IFS(B4>=90, "A", B4>=80, "B", B4>=70, "C", TRUE, "D")returnsA
Common mistakes
- 1
Quoting the wrong things
Text results need quotes:
=IF(B2>=50,Pass,Fail)gives #NAME? because Excel reads Pass as a name. Numbers don't:B2>="50"compares the score with the text "50" and gives the wrong answer. - 2
Testing conditions in the wrong order
IFS and nested IFs stop at the first TRUE condition. If
B2>=50comes beforeB2>=90, a score of 95 stops at the first test and never reaches the top band. Start with the strictest condition. - 3
Leaving IFS without a fallback
When none of its conditions is TRUE, IFS returns #N/A. End it with
TRUE, "value"so every row gets an answer.