#!Intermediate

IFERROR and IFNA practice exercises

#DIV/0!, #N/A and #VALUE! make reports look broken. Learn when each error appears and how to replace it with a clean result using IFERROR, IFNA and ISBLANK.

11 exercises0/11
Start practicing →

Try it yourself

A live spreadsheet. Type a formula and press Enter to check it.

Exercise 1 of 11IFERROR

Work out the cost per unit for Travel (Actual ÷ Units). Units is 0, so show 0 instead of an error.

Write your formula in the green cell, G2.

team-budget.xlsx
fx
1CategoryBudgetActualUnits
2Rent$2,400.00$2,400.001Travel/unit
3Software$600.00$645.0012
4Travel$1,500.00$0.000
5Marketing$2,000.00$2,310.005
6Training$800.000
7Supplies$300.00$276.000
8
9
10

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 error handling exercises

  1. 1

    Avoid #DIV/0!

    Free

    Work out the cost per unit for Travel (Actual ÷ Units). Units is 0, so show 0 instead of an error.

  2. 2

    Missing lookups

    Free

    Look up the budget for Events. It isn't in the table, so return "No budget".

  3. 3

    Check for a number

    Premium

    Is there a number in Training's Actual cell? Return TRUE or FALSE.

  4. 4

    Count empty cells

    Premium

    How many categories have no Actual figure entered yet?

  5. 5

    Budget variance

    Premium

    By what percentage did Marketing go over budget? (Actual − Budget) ÷ Budget.

  6. 6

    IFERROR with a message

    Premium

    Work out the cost per unit for Supplies (Actual ÷ Units). It has no units, so show "No units" instead of an error.

  7. 7

    Blank or not

    Premium

    Return "Not started" if Training's Actual cell is blank, otherwise "Started".

  8. 8

    Check before you calculate

    Premium

    Work out Training's variance %, (Actual − Budget) ÷ Budget, but show "No data" if its Actual cell is blank.

  9. 9

    IFNA with MATCH

    Premium

    Find the position of "Hardware" in the Category list. It isn't there, so return "Missing" instead of #N/A.

  10. 10

    How many went over?

    Premium

    How many categories spent more than their budget? Use one formula.

  11. 11

    Add up with a condition

    Premium

    What is the total overspend: how much the categories that went over budget spent above their budgets, added together?

The error handling functions, with examples

Every example runs on team-budget.xlsx, the same sheet the exercises use, and the results are calculated from that data.

  • IFERROR

    Returns a value of your choice when a formula gives any error, and the normal result otherwise. Here, Travel has no units, so the division fails.

    IFERROR(value, value_if_error)

    Example

    =IFERROR(C4/D4, "No units")returnsNo units
  • IFNA

    Like IFERROR, but only catches #N/A, the “not found” error, so other mistakes still show.

    IFNA(value, value_if_na)

    Example

    =IFNA(VLOOKUP("Legal", A2:B7, 2, FALSE), "Not budgeted")returnsNot budgeted
  • ISBLANK

    Returns TRUE if a cell is completely empty. Useful for flagging missing data before it breaks a calculation.

    ISBLANK(value)

    Example

    =ISBLANK(C6)returnsTRUE
  • SUMPRODUCT

    Multiplies ranges row by row and adds up the results. Conditions written as (range>value) turn it into a flexible conditional sum.

    SUMPRODUCT(array1, [array2], …)

    Example

    =SUMPRODUCT((C2:C7>B2:B7)*(C2:C7-B2:B7))returns$355.00

Common mistakes

  1. 1

    Hiding every error with IFERROR

    IFERROR(…,0) also hides typos and broken references, so a wrong total looks fine. Catch only the error you expect: IFNA for lookups, or IF(D2=0,…) for a divisor that can be zero.

  2. 2

    Assuming empty means zero, or "" means empty

    Empty cells count as 0 in arithmetic, and ISBLANK is FALSE for a cell whose formula returns "". When formulas fill a column, test with C6="", which is TRUE in both cases.

  3. 3

    Treating every error the same

    Each error points somewhere different: #N/A means a value wasn't found, #VALUE! means the wrong type (like text in a sum), #DIV/0! means dividing by zero or an empty cell, and #REF! means the formula points at cells that were deleted.