ProofDrill

#N/A

A lookup couldn’t find what it was asked to find.

The error, and the fix

How many seats are left on course C-07?

E2=XLOOKUP(D2,A2:A4,C2:C4)

RowABCDEF
1CodeCourseSeatsFindLookupWith a fallback
2C-04Budgets12C-07
3C-05Payroll3
4C-06Forecasts8

C-07 isn’t in the list, so the plain lookup shows #N/A. The fourth argument says what to show instead.

Why it happens, and how to fix it

The value isn’t in the list
Check the spelling, or that the item has been added. When a missing item is normal, show a message instead with XLOOKUP’s fourth argument, or wrap the lookup in IFNA.
Hidden spaces
“C-07 ” with a space at the end doesn’t match “C-07”. Clean the codes with TRIM, or trim the value you look up: TRIM(D2).
A number stored as text
1024 typed as text doesn’t match the number 1024. Text sits on the left of a cell by default and numbers on the right; make both the same type.
VLOOKUP without FALSE
Left out, VLOOKUP’s last argument asks for an approximate match, which needs a sorted list. On an unsorted list it can give #N/A or the wrong row. Add FALSE, or use XLOOKUP, which matches exactly unless told otherwise.
A range that moved when copied
Copied down without $, A2:A6 becomes A3:A7 and misses the first row. Lock it as $A$2:$A$6 (press F4).

Questions

How do I hide #N/A in Excel?

Say what to show instead: =XLOOKUP(D2,A2:A4,C2:C4,"Not found"), or =IFNA(VLOOKUP(D2,A2:C4,3,FALSE),"Not found") in versions without XLOOKUP. If the item should have been found, fix the cause first.

What is the difference between IFNA and IFERROR?

IFNA catches only #N/A, the error a lookup gives when nothing matches. IFERROR catches every error, so it can also hide a typo or a broken reference you would want to see.

Free · no account

Practise the fix

Real tasks in a spreadsheet, checked on changed data, so your fix has to work on data you can’t see.

Try it now

Stop it happening

  • Decide what a missing item should show, and say so with XLOOKUP’s fourth argument or IFNA.
  • Use IFNA rather than IFERROR around a lookup: IFERROR also hides a misspelt function or a broken reference.
  • Keep codes in one format: no extra spaces, and all text or all numbers.

Lessons

Other errors