Function · Logical
Excel IFNA function
The Excel IFNA function replaces only #N/A. A lookup of WY in the five-state rate table becomes Add this state. A #REF! still shows.
Syntax =IFNA(value, value_if_na)
=IFNA(VLOOKUP("WY",A2:B6,2,FALSE),"Add this state")Arguments
| Name | Required | What to pass |
|---|---|---|
| value | Required | The formula to try. |
| value_if_na | Required | What to return when value is #N/A. Any other error is returned as itself. |
Examples
Wyoming is not in the five-state rate table
=IFNA(VLOOKUP("WY",A2:B6,2,FALSE),"Add this state")Result Add this state
| A | B | C | D | |
|---|---|---|---|---|
| 1 | State | Rate | Lookup | |
| 2 | CA | 7.25% | WY | |
| 3 | FL | 6.00% | Add this state | |
| 4 | MA | 6.25% | ||
| 5 | NY | 4.00% | ||
| 6 | TX | 6.25% |
IFNA runs a formula and steps in only when the result is #N/A. VLOOKUP of WY in a table of CA, FL, MA, NY, and TX is #N/A, and the wrapper returns Add this state. Those are the same statewide rates used on the VLOOKUP page, from the Tax Foundation table of January 1, 2026. Local tax is often extra.
IFERROR would also return the message, and it would do the same for #REF!, #NAME?, and #DIV/0!. A typo in the function name then looks like a missing state. IFNA leaves those alone. XLOOKUP can carry the fallback itself, so a workbook that already has XLOOKUP does not need this wrapper for a simple miss.