Logiceasy

IFNA()

Returns the first argument unless it is the #N/A error, in which case returns the second.

Syntax
fx
=IFNA(value, value_if_na)
Arguments
ArgumentDescription
valueThe value to return if it is not #N/A.
value_if_naThe value to return when value evaluates to #N/A.
Example
fx
=IFNA(VLOOKUP("X", A:B, 2, FALSE), "Not found")

Paste this into Google Sheets to run it. The live playground on this site covers 24 of the 61 functions, and IFNA isn't one of them yet.

Common pitfalls

  • Catches only the #N/A error; other errors (#REF!, #VALUE!, #DIV/0!) still bubble up. That's usually what you want.
  • Most useful right around lookup formulas like VLOOKUP/XLOOKUP/MATCH where #N/A means "not found" rather than a real bug.
Related formulas
IFERROR()
Returns the first argument if it isn't an error; otherwise returns the second.
IF()
Returns one value if a condition is TRUE, another if FALSE.
VLOOKUP()
Vertical lookup. Searches the first column of a range and returns a value from a specified column.
Used by
IFERROR()
Returns the first argument if it isn't an error; otherwise returns the second.