Hands-On Excel IF and logic

Excel IF function exercises

Eleven exercises on making a sheet decide: TRUE and FALSE comparisons, IF, AND, OR and XOR, nested IF, IFS, SWITCH, the IS functions and IFERROR, plus a mistake hunt on a commission sheet that pays the wrong amounts. Each runs on an Excel-style sheet in your browser and checks the result your formula gives, then tells you what went wrong.

11 lessonsAbout 33 minutesBy Updated

The 11 exercises

Each one is a short task on an Excel-style sheet in your browser, free and without sign-up. The checker looks at the result, so any formula that gets it right passes, and a wrong one gets the reason.

  1. TRUE or FALSE? Comparisons, Starter, 3 min

    A comparison such as =A2>100 is a formula on its own and shows TRUE or FALSE.

  2. Pass or fail? IF, Core, 3 min

    IF checks a condition and shows one result when it is true and another when it is false.

  3. Both or either? AND, OR, Core, 3 min

    AND is TRUE only when every test is true; OR is TRUE when at least one is.

  4. Exactly one of the two XOR, Core, 3 min

    XOR is TRUE when exactly one of two tests is true, and FALSE when both are or neither is.

  5. Grade bands with nested IF Nested IF, Core, 3 min

    A nested IF puts one IF inside another to choose between more than two results, checked in order.

  6. Many conditions, no nesting IFS, Core, 3 min

    IFS checks several conditions in order and returns the value for the first one that is TRUE, without nesting IFs.

  7. Match a code with SWITCH SWITCH, Core, 3 min

    SWITCH compares one value with a list of exact matches and returns the result paired with the one it equals, or a default.

  8. IF with AND and OR IF + AND, OR, Core, 3 min

    AND and OR can sit inside each other and inside IF, so one test can mix "all of these" with "any of those".

  9. What's in this cell? ISNUMBER, ISTEXT, ISBLANK, Core, 3 min

    ISNUMBER, ISTEXT and ISBLANK say what a cell holds: a number, text, or nothing at all.

  10. Catch the error, not the bug IFERROR, Core, 3 min

    IFERROR shows a formula's result, or a value you choose when the formula returns an error.

  11. Mistake hunt: the commission sheet Fixing IF, Core, 3 min

    An IF that looks right can still pay the wrong amount: a > where >= was meant, results in the wrong order, or a number in quotes.

Do module 5 in order, step by step, in the courseAll 126 exercises

FAQ

Which should I learn first, IF or IFS?
IF. It works in every version of Excel and Google Sheets, IFS needs Excel 2019 or later, and IFS is easy once you know how IF reads its tests in order.
When is a lookup table better than IF?
When the bands or codes change, or there are more than three or four of them. The values then live in cells you can edit, and the formula stays the same: a VLOOKUP or XLOOKUP on a small table replaces a long nested IF.
Do these exercises help with Excel interview tests?
IF with AND or OR, nested IF and IFERROR are standard topics in Excel tests for office and analyst jobs, often with a value sitting exactly on a limit. The exercises use the same kind of edge cases.