What is the IFNA function?
=IFNA(value, value_if_na)IFNA returns a value you choose only when a formula gives the #N/A error, and otherwise returns the formula result. #N/A is the error VLOOKUP, MATCH and XLOOKUP give when they cannot find the value.
IFERROR hides every error, but IFNA replaces only #N/A. So you can handle "a code not in the list" cleanly while real problems, such as a #VALUE! from a price entered as text, stay visible.
Arguments
- value
- The formula to check for #N/A. Usually VLOOKUP or MATCH.
- value_if_na
- The value to return instead when value is #N/A. "" shows a blank.
IFNA examples
Example 1. A message when not found
=IFNA(VLOOKUP(E2, $A$2:$C$5, 3, FALSE), "Check code")A code not in the product table shows "Check code".
Example 2. 0 when not found
=IFNA(VLOOKUP(E2, $A$2:$C$5, 3, FALSE), 0)For a column you will total, use 0 so SUM does not break.
Example 3. With MATCH
=IFNA(MATCH(A2, list, 0), "None")Shows the position if it is in the list, or "None" if not.
Common mistakes
Thinking it hides every error
IFNA replaces only #N/A. #VALUE! and #DIV/0! stay visible. Use IFERROR to replace every error.
Compatibility with old files
IFNA was added in Excel 2013. If the file must open in older versions, write IF(ISNA(...), ..., ...).
FAQ
- Why use IFNA instead of IFERROR?
- It handles only failed lookups and does not hide other errors, so data problems are not missed.
- Is it needed with XLOOKUP?
- XLOOKUP's fourth argument sets the value when nothing is found, so you can do without IFNA.