Skip to content

Lesson 67 of 92 · Free Excel Course

Excel · Excel function reference

Excel IFNA Function: Syntax, Examples and Common Errors

How the Excel IFNA function replaces #N/A with your own text or 0, why it's safer than IFERROR around lookups, and examples with VLOOKUP, MATCH and XLOOKUP.

The IFNA function checks a formula for the #N/A error and, if it finds one, shows a value you choose instead, such as "Not found", a blank or 0. If the formula works, IFNA simply returns its normal result. Because #N/A is the error lookups give when they can't find something, IFNA is almost always wrapped around VLOOKUP, HLOOKUP or MATCH. It ignores every other error on purpose. Microsoft lists it for Excel for Microsoft 365 (Windows and Mac), Excel for the web and Excel 2024, 2021, 2019 and 2016.

Syntax

=IFNA(value, value_if_na)
  • value (required): the formula or cell to check. This is normally a lookup, such as VLOOKUP(C3,C6:D11,2,FALSE). If it gives a normal answer, IFNA returns that answer unchanged.
  • value_if_na (required): what to show when value is #N/A. It can be text in quotes ("Not found"), a number (0), an empty pair of quotes ("") for a cell that looks blank, a cell reference, or another formula.

There's no default for either argument. If value gives any error other than #N/A, such as #REF! or #VALUE!, IFNA lets it through untouched. If value is a range that spills several results, IFNA returns one result per cell.

Examples

Microsoft's example: a city that isn't in the list. The region table runs from C6 to D11, and Seattle isn't in it. On its own, the VLOOKUP returns #N/A; wrapped in IFNA it shows a clear message.

D3=IFNA(VLOOKUP(C3,C6:D11,2,FALSE),"Not found")
CD
2CityRegion ID
3SeattleNot found
4
5CityRegion ID
6Atlanta105
7Portland142
8Chicago175
9Los Angeles251
10Boise266
11Cleveland275
Microsoft's own example. Type Boise in C3 instead and D3 shows 266.

IFNA with MATCH. MATCH returns a position, and #N/A when the name isn't there. Here it tells each person where they are on a waitlist.

B3=IFNA(MATCH(A3,$D$2:$D$6,0),"Not on list")
ABCD
1NameWaitlist spotWaitlist
2Lena3Priya
3JamalNot on listMarcus
4Owen4Lena
5Priya1Owen
6Sofia
The 0 in MATCH asks for an exact match. Jamal isn't in D2:D6, so IFNA shows the message.

Return 0 so a total still works. One #N/A in a column makes SUM return #N/A too. Here, monthly spending is pulled from a bank export that has no Dining out line. Returning 0 keeps the total working.

B4=IFNA(VLOOKUP(A4,$E$2:$F$4,2,FALSE),0)
ABCDEF
1CategorySpentBank exportAmount
2Groceries$412.50Groceries$412.50
3Gas$96.20Gas$96.20
4Dining out$0.00Gym$35.00
5Gym$35.00
6Total$543.70
B6 is =SUM(B2:B5). Without IFNA, B4 and the total would both show #N/A.

Use 0 rather than "" whenever the result feeds more math. SUM skips the empty text "", but a plain formula such as =B4*2 returns #VALUE! on it.

IFNA vs IFERROR: why IFNA is safer. Both formulas below have the same mistake: column 3 of a table that only has 2 columns. VLOOKUP returns #REF!. IFNA lets you see it; IFERROR covers it with "Not found", even though T-200 is in the list.

B2=IFNA(VLOOKUP(A2,$E$2:$F$4,3,FALSE),"Not found")
ABCDEF
1SKUWith IFNAWith IFERRORSKUPrice
2T-200#REF!Not foundT-100$8.99
3T-300#REF!Not foundT-200$12.49
4T-300$15.00
C2 uses =IFERROR(VLOOKUP(A2,$E$2:$F$4,3,FALSE),"Not found"). Change the 3 to a 2 and both columns show $12.49 and $15.00.

The XLOOKUP alternative. XLOOKUP has a built-in fourth argument, if_not_found, so Microsoft's example becomes =XLOOKUP(C3,C6:C11,D6:D11,"Not found") with no IFNA at all. XLOOKUP needs Microsoft 365, Excel 2021 or later, or Excel for the web; in Excel 2016 and 2019, stick with IFNA around VLOOKUP or INDEX and MATCH.

Common errors

  • #NAME?: the function name is misspelled, or the workbook is open in Excel 2010 or earlier, which doesn't have IFNA. In old versions use =IF(ISNA(VLOOKUP(...)),"Not found",VLOOKUP(...)).
  • #REF!, #VALUE! or #DIV/0! still showing: that's IFNA working as designed. These errors mean the formula itself is wrong (a column number past the end of the table, text where a number should be, a division by zero). Fix the formula; don't switch to IFERROR just to hide it.
  • Your message appears for a value that's clearly in the list: the lookup really returned #N/A. Usual causes are extra spaces ("Boise " with a trailing space) or a number stored as text on one side, such as an ID typed as text in the table but as a number in the lookup cell. Remove IFNA briefly, clean the data with TRIM or VALUE, then put it back.
  • #VALUE! further down the sheet: you returned "" and another formula multiplies or adds it with +. Return 0 instead.
  • Still #N/A in every row: IFNA is wrapped around the wrong part, for example =VLOOKUP(IFNA(A2,""),...). IFNA must wrap the whole lookup.

Related functions

Try it yourself

Download the practice workbook. It has Microsoft's city lookup, the MATCH waitlist, the budget that needs 0 instead of #N/A, and the IFNA vs IFERROR test with the deliberate column mistake, with yellow cells to fill in and an Answers sheet to check your work.

Frequently asked questions

What is the difference between IFNA and IFERROR?

IFNA catches only the #N/A error, the one a lookup gives when it can't find a value. IFERROR catches every error, including #REF!, #VALUE!, #DIV/0! and #NAME?. Around a lookup, IFNA is usually the better choice: a missing item gets your message, but a real mistake in the formula still shows up so you can fix it.

How do I show a blank instead of #N/A in Excel?

Use an empty pair of quotes as the second argument: =IFNA(VLOOKUP(A2,$E$2:$F$9,2,FALSE),""). If other formulas do math with the result, use 0 instead, because a formula like =B2*2 returns #VALUE! when B2 holds the empty text "".

Do I need IFNA with XLOOKUP?

Usually not. XLOOKUP has its own if_not_found argument: =XLOOKUP(A2,E2:E9,F2:F9,"Not found") does the same job. IFNA is still useful with VLOOKUP, HLOOKUP and MATCH, and in Excel 2016 and 2019, which don't have XLOOKUP.

Why does IFNA show my message when the value is in the list?

The lookup really is returning #N/A, and IFNA is just hiding it. The usual causes are an extra space ("Boise " isn't "Boise") or a number stored as text on one side. Remove IFNA for a moment, fix the data with TRIM or VALUE, then put IFNA back.

Which versions of Excel have IFNA?

Microsoft lists Excel for Microsoft 365 (Windows and Mac), Excel for the web, and Excel 2024, 2021, 2019 and 2016. It first appeared in Excel 2013, so Excel 2010 and earlier show #NAME?. There, use =IF(ISNA(formula),"Not found",formula) instead.