Excel Supreme

Excel track · Exercise 69 of 86 Paid

Error handling: which net catches what

Choose the wide net or the narrow one on purpose, and wrap the whole calculation in it.

Advanced

Code, price and units table with one blank units cell

Read-only data · screen 1 of 2 · answer in B9

In B9, price the code in A8 and say no match when any part of the lookup fails.

AB
1CodePrice
2A-110
3B-220
4C-330
5A-112
6B-222
7C-332
8Q-9
9Any failure

Download this grid (.xlsx) Two tabs: the grid you see, and the answer.

B9

What it does

IFERROR returns its second argument whenever the first one fails, whatever the reason. IFNA returns the second argument only for #N/A. The wide net catches a missing code and a blank divisor; the narrow one catches the missing code and lets the rest show.

The first screen prices Q-9, which is not in A2:B7, so the lookup misses and the cell reads no match. The second divides B4 by an empty C4: 30 divided by a blank cell raises #DIV/0!, and IFNA would have left it standing.

Choose the net by what the sheet should hide. A wide net keeps a report tidy and turns a broken reference into words that look like missing data. Put either net around the whole calculation, so whatever is added inside it later is covered too.

Syntax

=IFERROR(value, fallback) catches everything; =IFNA(value, fallback) catches only #N/A

Worked example

On Code, price and units table with one blank units cell, =IFERROR(VLOOKUP(A8,A2:B7,2,FALSE),"no match") returns no match.

=IFERROR(VLOOKUP(A8,A2:B7,2,FALSE),"no match")

Common errors

Error codes for IFERROR versus IFNA on a missing lookup and on a division by a blank cell
ErrorWhat it means and how to fix it
#DIV/0!C4 is blank, so the division has no divisor; only the wide net answers it with words.
#N/AThe lookup found no Q-9, the error IFNA is built to replace.
Hidden faultThe wide net reports a broken reference as no match, so a real formula fault passes for absent data.

At work

A month-end report where missing codes and blank divisors both need a word, and a broken reference still needs finding.