How to Get Rid of #N/A Errors in Excel (VLOOKUP Not Found)
#N/A means the value you are looking for is not in the table. To show a blank or "Not found" instead, wrap the formula in IFNA.
Formula to use
=IFNA(VLOOKUP(E2, $A$2:$C$100, 3, FALSE), "Not found")"Not found" when there is no match
The difference between IFNA and IFERROR
IFNA replaces only #N/A and leaves other errors visible. IFERROR replaces every error, including #VALUE! and #DIV/0!, so it can hide a formula that is actually wrong. IFNA is the safer choice for lookups.
=IFERROR(VLOOKUP(E2, $A$2:$C$100, 3, FALSE), "")Every error becomes a blank
XLOOKUP takes a default directly
In Excel 2021 and later, the fourth argument of XLOOKUP is the value to show when nothing is found.
=XLOOKUP(E2, A2:A100, C2:C100, "Not found")No wrapper needed
#N/A even though the value is there
A space on only one side makes the values different. Try wrapping the lookup value in TRIM(E2).
If one side is a number and the other a number stored as text, they look the same but do not match. Convert with VALUE, or make both text with E2&"".
If you leave out the last argument of VLOOKUP, it uses approximate match and can return the wrong value or #N/A. Use FALSE for an exact match.
Try the functions used here
Change the arguments in the function playground and watch the calculation step by step.
- IFNA functionReturns a value you choose only when a formula gives #N/A; otherwise returns the formula result.
- IFERROR functionReturns a value you choose if a formula results in an error; otherwise returns the formula's result.
- VLOOKUP functionFinds a value in the first column of a table and returns a value from another column in the same row.
- XLOOKUP functionFinds a value in one range and returns the value at the same position in another range. It can return values to the left, too.
- ISNA functionChecks whether a value is the #N/A error.
- TRIM functionRemoves leading and trailing spaces and leaves single spaces between words.
FAQ
- How do I count only the #N/A cells?
- Count them with =SUMPRODUCT(--ISNA(B2:B100)).
- Is it fine to turn errors into 0?
- 0 is convenient for values you will total, but then "not found" and "zero" look the same, so choose what fits the purpose.