IFNA replaces the #N/A error with a value of your choice, and leaves every other result alone. =IFNA(VLOOKUP(A9, A2:C20, 3, FALSE), "Not listed") shows "Not listed" when the lookup doesn't find A9, and shows the real value otherwise.
What #N/A means
#N/A means "not available": a lookup found no match. It is the one error that is often expected, since a lookup value may truly be missing from a list. VLOOKUP, HLOOKUP, MATCH, XMATCH and LOOKUP all return it when nothing matches. NA() returns it on purpose.
IFNA or IFERROR
Both functions have two arguments, and both return the second when the first is an error. The difference is which errors count:
- IFERROR replaces every error:
#N/A, #VALUE!, #REF!, #DIV/0!, #NAME? and the rest. - IFNA replaces only
#N/A.
For a lookup, that difference matters. Suppose someone deletes the column your VLOOKUP reads. The formula starts returning #REF!. With IFERROR, every row quietly shows "Not listed". With IFNA, the #REF! stays on screen, and you know something is broken. IFNA says exactly what you mean: "if the value isn't found, show this".
Modern alternatives
XLOOKUP has a built-in fourth argument, if_not_found, so =XLOOKUP(A9, A2:A20, C2:C20, "Not listed") needs no wrapper. XMATCH has no such argument, so =IFNA(XMATCH(...), 0) is still the usual way to give a not-found result a value. VLOOKUP, HLOOKUP, MATCH and LOOKUP have no built-in option, so IFNA is the standard answer for them.
Choosing the replacement
- Text such as
"Not listed" is best when a person reads the result. 0 is convenient for sums, but a missing item then looks like a real zero."" leaves the cell looking blank, but it holds empty text, and arithmetic on it returns #VALUE!.- Another lookup is a common pattern:
=IFNA(VLOOKUP(A2, Table1, 2, FALSE), VLOOKUP(A2, Table2, 2, FALSE)) searches a second list when the first has no match.
Compatibility
IFNA was added in Excel 2013. In Excel 2010 and earlier it returns #NAME?. If the file has to open there, use =IF(ISNA(formula), fallback, formula), which repeats the lookup, so it is slower.
Where #N/A should stay
Don't hide #N/A when the missing value is a data problem you want to find. A list of unmatched IDs is useful information. Consider counting the matches that failed with =SUMPRODUCT(--ISNA(range)) before you replace the errors with a message.