Spreadsheet Practice

What is the difference between IFERROR and IFNA in Excel?

Formula (Excel and Google Sheets)

=IFNA(VLOOKUP(A2,$E$2:$F$5,2,FALSE),0)*B2

IFNA replaces only #N/A, the "not found" error; IFERROR replaces every error. Wrap lookups in IFNA so real mistakes still show: =IFNA(VLOOKUP(…),0)*B2.

Result on the example
one result per row in C2, filled down to C6
Works in
Excel 2013 and later
Google Sheets
Same formula

See it work

The formula is already in C2, filled down to C6. Change any input and the result updates, or edit the formula to experiment.

How it works

P-109 isn't in the price list, so VLOOKUP returns #N/A and IFNA turns it into 0. Row 4 has the quantity typed as the word "two", so the multiplication fails with #VALUE!, and IFNA leaves that error showing. That is the point: a bad quantity is a data problem to fix, not a missing product. IFERROR would hide both behind 0.

=IFNA(VLOOKUP(A2,$E$2:$F$5,2,FALSE),0)*B2

Result159.96

  1. A2"P-101"

    The value in A2.

  2. $E$2:$F$54 rows × 2 cols: "P-101", $39.99, "P-102", $249.00, …

    A range: 4 rows × 2 columns.

  3. VLOOKUP(A2,$E$2:$F$5,2,FALSE)39.99

    VLOOKUP: Finds a value in the first column and returns a value from the same row. Use FALSE for exact.

    • lookup_valueA2"P-101"
    • table_array$E$2:$F$54 rows × 2 cols: "P-101", $39.99, "P-102", $249.00, …
    • col_index_num2
    • range_lookupFALSE
  4. IFNA(VLOOKUP(A2,$E$2:$F$5,2,FALSE),0)39.99

    IFNA: Returns a fallback only for #N/A.

    • valueVLOOKUP(A2,$E$2:$F$5,2,FALSE)39.99
    • value_if_na0not used
  5. B24

    The value in B2.

  6. IFNA(VLOOKUP(A2,$E$2:$F$5,2,FALSE),0)*B2159.96

    The * operator multiplies.

In Google Sheets

The same formula works in Google Sheets: =IFNA(VLOOKUP(A2,$E$2:$F$5,2,FALSE),0)*B2. We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=IFERROR(VLOOKUP(A2,$E$2:$F$5,2,FALSE)*B2,0)$159.96, $0.00, $0.00…Different resultIFERROR around the whole calculation hides the bad quantity too. Row 4 shows 0 instead of #VALUE!, hiding the typo.
=XLOOKUP(A2,$E$2:$E$5,$F$2:$F$5,0)*B2$159.96, $0.00, #VALUE!…XLOOKUP's fourth argument is a built-in IFNA: it covers "not found" only.

Common mistakes

  • IFERROR around a whole calculation hides typos, deleted columns (#REF!) and text in number cells. Wrap only the part that can legitimately fail.
  • IFNA needs Excel 2013 or later. Google Sheets has it too.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

What is the difference between IFERROR and IFNA

In C2, multiply the quantity by the price looked up in E2:F5, using a price of 0 when the SKU isn't listed but letting any other error show. Fill down to C6.

Questions

When is IFERROR the right choice?

When every possible error means the same thing, as in =IFERROR(B2/C2,0), where the only error is dividing by zero.

How do I test which error a cell has?

ISNA is TRUE only for #N/A, ISERR for every other error, and ISERROR for all of them.

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.