Example
The IFNA function can be used to trap #N/A errors that may occur with the VLOOKUP function. In the example shown, the formula in F5, copied down, is: where xtable is the named range B5:C12. When the lookup value in column E is found in xtable, VLOOKUP returns the exchange range normally. When the lookup value is not found, VLOOKUP returns #N/A, and IFNA catches this error and returns “Not found”.
IFERROR or IFNA?
The IFERROR function is a useful function, but it is a blunt instrument, since it will trap many kinds of errors. For example, if there’s a typo in a formula, Excel may return the #NAME? error, but IFERROR will suppress the error and return the alternative result. This can obscure an important problem. In many cases, it makes more sense to use the IFNA function, which only traps the #N/A error.
Other error functions
Excel provides a number of error-related functions, each with a different behavior:
The ISERR function returns TRUE for any error type except the #N/A error. The ISERROR function returns TRUE for any error. The ISNA function returns TRUE for #N/A errors only. The ERROR.TYPE function returns the numeric code for a given error. The IFERROR function traps errors and provides an alternative result. The IFNA function traps #N/A errors and provides an alternative result.
Notes
If value is empty, it is evaluated as an empty string ("") and not an error. If value_if_na is supplied as an empty string (""), no message is displayed when an error is detected.
Dave Bruns
Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.