IFNA

Catch #N/A and nothing else, so a genuine problem still surfaces instead of being hidden.

Syntax

IFNA(value, value_if_na)
Argument Required Description
value Required The formula to evaluate, usually a lookup.
value_if_na Required What to return if that formula produces #N/A specifically.

Examples

Every example below was executed against VisiGrid engine 0.35.0 — not transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.

Formula Result Notes
=IFNA(VLOOKUP(9,A2:B3,2,FALSE),"no match") no match The lookup finds nothing, so the fallback is used.
=IFNA(1/0,"caught") #DIV/0! Not an #N/A, so it passes straight through — this is the point of the function.
=IFERROR(1/0,"caught") caught For contrast. IFERROR would have hidden it.

Usually what people mean when they write IFERROR

IFERROR catches every error — #N/A, #REF!, #DIV/0!, #VALUE!, #NAME?. Wrapped around a lookup, it hides the missing match you expected and the broken range you did not.

=IFERROR(VLOOKUP(999, A2:D4, 3, FALSE), "none")

Delete column C tomorrow and that formula does not start failing. It keeps saying none, and the spreadsheet looks like it is working.

IFNA catches only #N/A:

=IFNA(1/0, "caught")     → #DIV/0!, passed through untouched
=IFERROR(1/0, "caught")  → caught

So a lookup that finds nothing shows your message, and a lookup whose range has been destroyed still shows #REF! — which is the error you actually needed to see.

When IFERROR is still right

When you have thought about which errors are possible and decided you want all of them hidden. That is a narrower situation than its popularity suggests, and IFNA is the safer default around anything that looks up a value.

XLOOKUP takes a not-found value as its fourth argument and needs neither wrapper — see XLOOKUP vs VLOOKUP.

Excel compatibility

Matches Excel.

Related functions

Last updated