Reading and Handling Errors
Diagnose #N/A, #DIV/0!, #VALUE!, #REF! and #NAME? errors, prevent them at the source, and use IFERROR and IFNA without hiding real problems.
Welcome back!
Step 1 of 11Learn
Errors are messages, not failures
Monday morning, a regional sales dashboard opens with #DIV/0! in the margin column and #N/A scattered across the product sheet. The analyst who built it is on vacation. Panic is optional: every Excel error value is a specific message about what went wrong, and once you can read them, most take a minute to fix.
Errors also propagate. If C2 contains #N/A, then =C2*1.1 is #N/A, and =SUM(C2:C100) is #N/A too. One bad cell can turn a whole report into errors. That's annoying, but it's also useful: a total that shows an error is much safer than a total that is silently wrong.
So the approach has two parts. First, read the error and fix the cause where you can. Second, for errors that are expected, such as a product code that legitimately isn't in the price list yet, handle them deliberately with a function like IFNA, and show something meaningful instead. The mistake to avoid is the third option many people choose: wrapping everything in IFERROR(...,0) so the errors disappear and so do the clues.
Step 2 of 11Practice · Match the pairs
Match each error value to its most common cause.
Tap an answer, then tap the place where it belongs (or drag it there).
- #DIV/0!
- #N/A
- #NAME?
- #REF!
- #VALUE!
Step 3 of 11Learn
The usual suspects
#DIV/0! appears when a formula divides by zero or by a blank cell. Average order value calculated as =Revenue/Orders errors for a store with no orders yet.
#N/A means a lookup couldn't find what it was looking for. Causes: the value really is missing, a trailing space ("A-100 " vs "A-100"), or a number stored as text in one list and as a number in the other.
#VALUE! means an operation got the wrong kind of data, typically text in arithmetic: =B2*C2 where C2 contains "n/a" or "12 units".
#REF! means a reference points at cells that no longer exist, usually because a row, column or sheet was deleted. The formula literally contains #REF! in place of the address, and the original reference is gone, so undo (Ctrl+Z) or rebuild it.
#NAME? means Excel doesn't recognize a word in the formula: a typo like =VLOKUP, text without quotes such as =IF(A2=Yes,...), an undefined named range, or a new function opened in an old version.
You'll also meet #NUM! (impossible math, like =SQRT(-4)), #SPILL! (covered in the dynamic arrays lesson) and ########, which isn't an error at all: the column is just too narrow to show the number.
Step 4 of 11Flashcards
Error value: first thing to check
Tap a card to flip it.
Step 5 of 11Practice · Choose one
A sheet has =SUM(B2:B10)/COUNT(C2:C10), and column C is completely empty. What does it return?
Step 6 of 11Learn
IFERROR and IFNA
Two functions replace an error with something you choose:
=IFERROR(value, value_if_error) catches any error.
=IFNA(value, value_if_na) catches only #N/A.
For a price lookup where some new products aren't in the price list yet:
=IFNA(XLOOKUP(A2, Prices[Code], Prices[Price]), "Not in price list")
If the code is found, you get the price. If it isn't, you get a clear message instead of #N/A. Any other error, such as a #REF! because someone deleted the price column, still shows up, which is what you want.
With IFERROR, that #REF! would also turn into "Not in price list", and the broken workbook would look fine. That's why experienced builders prefer the narrowest handler: IFNA for lookups, a test like IF(B2=0, "", A2/B2) for division, and IFERROR only where any error genuinely means the same thing.
Think carefully about the replacement value, too. Returning 0 for a missing price makes the order total look cheaper instead of incomplete. A visible label, or a blank that's flagged with conditional formatting, keeps the problem in sight.
Step 7 of 11Note
Step 8 of 11Practice · What would you do?
What would you do?
Your order sheet looks up each product's price with XLOOKUP. Twelve new products aren't in the price list yet and show #N/A. What's the best approach?
Step 9 of 11Learn
Prevent errors at the source
Handling errors is good; avoiding them is better. A few habits remove most of them before they appear.
Guard divisions. =IF(B2=0, "", A2/B2) returns blank when there's nothing to divide by. It's more honest than IFERROR, because it handles exactly one known case.
Check types. ISNUMBER(B2) returns TRUE for real numbers, so =IF(ISNUMBER(B2), B2*C2, "Check quantity") flags rows where someone typed "twelve". ISBLANK(B2) tests for truly empty cells; note that a cell containing "" from a formula is not blank to ISBLANK, so B2="" is often the safer test.
Clean keys before lookups. Most #N/A errors on data you know is there come from invisible differences. TRIM removes extra spaces, and VALUE or TEXT makes number formats consistent on both sides.
Use tables and names. Structured references and named ranges don't break when columns move, and they reduce the deleted-cell #REF! errors that plain addresses cause.
Count your exceptions. A cell with =COUNTIF(D2:D500,"Not in price list") tells everyone how many rows need attention.
Step 10 of 11Practice · True or false
ISBLANK(A2) returns TRUE when A2 contains a formula that returns empty text ("").
Step 11 of 11Practice · Select all that apply
Which of these are good error-handling choices? Select all that apply.
Select all that apply.
Lesson complete!