Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel: Return 0 Instead of #N/A (Simple IFNA Guide)

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes — you can make Excel show 0 instead of #N/A. The cleanest way is to wrap your lookup formula in IFNA: =IFNA(VLOOKUP(A2, D:E, 2, FALSE), 0). This catches #N/A errors from VLOOKUP, XLOOKUP, MATCH or INDEX/MATCH and replaces them with a zero, while leaving any other formula result untouched. Older Excel versions without IFNA can use IFERROR or IF(ISNA(...)) instead.

What You'll Need

  • Excel for Windows, Mac, or Excel on the web — the IFNA function works in all of them
  • A lookup formula (VLOOKUP, XLOOKUP, HLOOKUP, INDEX/MATCH, etc.) that currently returns #N/A when a value is missing
  • Basic familiarity with typing formulas into a cell

Step-by-Step

  1. Find the cell showing #N/A. Click it and look in the formula bar. Note the full existing formula, for example =VLOOKUP(A2, D:E, 2, FALSE).
  2. Wrap the formula in IFNA. Edit the cell so the original formula becomes the first argument and 0 becomes the second. The pattern is: =IFNA(your_formula, 0). For our example that gives =IFNA(VLOOKUP(A2, D:E, 2, FALSE), 0). Note that the equals sign from the original formula is removed — only one goes at the very start.
  3. Press Enter. If the lookup fails, the cell now shows 0 instead of #N/A. If it succeeds, it shows the normal result unchanged.
  4. Copy the formula down. Click the cell, then drag the fill handle (the small square at the bottom-right corner of the selection) down over the rest of your column, or double-click the fill handle to auto-fill down to the end of adjacent data.
  5. Check other formulas that depend on this cell. A downstream SUM or AVERAGE that previously returned #N/A will now calculate normally, because the source cell contains a valid number (0).

If your Excel version does not have IFNA, use either of these equivalents in step 2:

  • =IFERROR(VLOOKUP(A2, D:E, 2, FALSE), 0) — catches all error types, not just #N/A
  • =IF(ISNA(VLOOKUP(A2, D:E, 2, FALSE)), 0, VLOOKUP(A2, D:E, 2, FALSE)) — works in the oldest versions but repeats the formula twice

For XLOOKUP, there is an even simpler built-in option: the third argument is the value to return if nothing is found, so =XLOOKUP(A2, D:D, E:E, 0) returns 0 on a failed match with no extra function needed.

Common Mistakes

  • Keeping two equals signs. Writing =IFNA(=VLOOKUP(...), 0) produces an error. Only the outermost function gets the equals sign.
  • Forgetting the second argument. =IFNA(VLOOKUP(...)) is invalid — IFNA requires both the value and the fallback.
  • Using IFERROR when you only want to hide #N/A. IFERROR also hides #VALUE!, #REF!, #NAME? and others, which can mask genuine formula mistakes. Prefer IFNA unless you deliberately want all errors suppressed.
  • Wrapping the wrong range. Make sure IFNA wraps the whole lookup, not just part of it, e.g. =IFNA(INDEX(B:B, MATCH(A2, C:C, 0)), 0) wraps the combined INDEX/MATCH, not MATCH alone.
  • Fixing symptoms instead of causes. If #N/A appears because of leading/trailing spaces or number-vs-text mismatches in your lookup column, consider cleaning the data (for example with TRIM) rather than only masking the result.

Tips

  • You can return any fallback value, not just 0 — for example "" for a blank-looking cell or "Not found" for text.
  • If you want zeros to display as blanks but still count in calculations, use a custom number format like 0;-0;;@ via Format Cells > Number > Custom (menu labels can differ slightly between Excel versions).
  • To apply the fix to a whole table at once, edit the top cell of the column and double-click the fill handle instead of dragging.
  • Remember that AVERAGE includes zeros, which can pull the average down. If that matters, use =AVERAGEIF(range, ">0") or return "" instead of 0.
  • Conditional formatting or filters that check for "0" will now pick up these cells — verify that's the behaviour you want before relying on filtered results.

Troubleshooting

  • The cell shows #NAME? This usually means IFNA isn't recognised, which happens in Excel versions older than 2013. Switch to the IFERROR or IF(ISNA(...)) alternatives above.
  • You still see #N/A. Check that the IFNA wraps the exact formula that is failing. If the #N/A comes from a different cell that feeds into this one, you must wrap the formula at its source.
  • The formula bar shows the formula as plain text. The cell is probably formatted as Text. Change it to General (Home tab > Number group), then re-enter the formula.
  • Every cell returns 0, even valid matches. Your lookup is failing for all rows — check the lookup value and range for extra spaces, mismatched data types (numbers stored as text), or a reversed range (VLOOKUP can only look to the right of the first column).
  • Results look right but totals changed. That's expected: cells that were errors are now numeric zeros and are included in sums and averages. Review any summary formulas that relied on the old behaviour.

Frequently Asked Questions

What's the difference between IFNA and IFERROR?

IFNA only catches the #N/A error, while IFERROR catches every error type (#DIV/0!, #VALUE!, #REF!, #NAME?, #N/A and more). IFNA is safer because it won't hide genuine formula mistakes.

Does this work in Google Sheets?

Yes. Google Sheets supports both IFNA and IFERROR with identical syntax, so the same formulas work there.

Can I return a blank instead of 0?

Yes — use IFNA(formula, ""). The cell will look empty, but note that a blank string is not a number, so it behaves differently in some calculations than a true 0.

Why does my VLOOKUP return #N/A in the first place?

Almost always because the lookup value isn't found in the first column of the range. Common causes: extra spaces, one value stored as text and the other as a number, or the range not including the lookup column as its leftmost column.

Will replacing #N/A with 0 affect my charts?

Possibly. Charts treat errors as gaps by default, but a 0 plots as an actual data point at zero, which can make a line drop to the baseline. Use "" or NA() inside IFNA if you'd rather keep gaps.