Course outline / Logical functions
Lesson 23 of 75 · Intermediate · 3 exercises
Handling errors
Replace errors with something useful using IFERROR and IFNA.
What you'll practise
- Hide a divide-by-zero
- Catch a missing lookup with IFNA
- A safe average price
Hide a divide-by-zero
Dividing by an empty cell or zero gives #DIV/0!. IFERROR shows something else instead.
=IFERROR(formula, value_if_error)
In cell F2, divide the Desk's sales (D3) by its units (C3), showing 0 if there is an error.
Catch a missing lookup with IFNA
IFNA only catches #N/A, the "not found" error from lookups. Other errors still show, which helps you spot real mistakes.
In cell F2, look up code "D40" in A2:B4 with VLOOKUP, showing "Not found" if it is missing.
A safe average price
In cell F2, divide the Lamp's sales (D2) by its units (C2), showing "-" if there is an error.
Try it in a real spreadsheet
Every step checks your answer instantly and tells you exactly what to fix.
Function guides
← Checking cells with IS functionsDoes a cell contain a word? →