Skip to content
getgriddy.ai/blog/how-to-use-iferror-in-excel
Excel

How to Use IFERROR in Excel

IFERROR replaces ugly spreadsheet errors with a cleaner fallback. Here's the syntax, the most common use cases, and when to avoid hiding real problems.

·5 min read

Reviewed by Griddy

Updated for current Excel and Google Sheets workflows, with examples chosen to map back to real spreadsheet tasks rather than abstract formula syntax.

IFERROR is the fastest way to replace spreadsheet errors with something more useful.

Instead of showing #N/A, #DIV/0!, or #VALUE!, you can return a blank, a label, or another calculation.

That makes sheets easier to read, especially when lookups, imports, or optional inputs are involved.

The syntax

fx
=IFERROR(value, value_if_error)
  • value — the formula or expression you want Excel to evaluate
  • value_if_error — what Excel should return if the first part throws an error

Basic example

If A2/B2 might divide by zero:

fx
=IFERROR(A2/B2, "")

If the division works, Excel returns the result.

If it fails, Excel returns a blank instead.

IFERROR with VLOOKUP

This is one of the most common patterns:

fx
=IFERROR(VLOOKUP(E2, A:C, 3, FALSE), "Not found")

If the lookup value exists, you get the matching result.

If it does not, the cell shows Not found instead of #N/A.

That is often easier for clients, teammates, or non-technical users to scan.

IFERROR with XLOOKUP

If you use XLOOKUP, you often do not need IFERROR because XLOOKUP has a built-in fallback:

fx
=XLOOKUP(E2, A2:A100, C2:C100, "Not found")

Use IFERROR around XLOOKUP only when you need to catch other error types too.

Common use cases

  • clean up lookup results in client-facing sheets
  • avoid divide-by-zero errors in dashboards
  • hide temporary import failures while data is still loading
  • replace missing optional inputs with a friendly message

TIP

Use "" as the fallback when you want the cell to appear blank. Use a text label like "Missing" when the user should notice the issue.

When IFERROR is the wrong move

IFERROR is useful, but it can also hide real problems.

If a formula is failing because the source range is wrong, the sheet structure changed, or a lookup key is malformed, wrapping everything in IFERROR can make debugging harder.

That is why it is better to ask:

  • is this error expected sometimes?
  • does the user need to know it happened?
  • should the fallback be blank, text, or a different formula?

IFERROR vs IFNA

If you only want to catch #N/A, use IFNA:

fx
=IFNA(VLOOKUP(E2, A:C, 3, FALSE), "Not found")

If you want to catch any error type, use IFERROR.

FunctionWhat it catches
IFNA#N/A only
IFERRORAny Excel error

The Griddy way

You do not need to remember when to wrap a formula manually. Just describe the behavior you want:

"Look up the client tier by company name, and if there is no match show Pending review"

Griddy writes the lookup, adds the right fallback, and places it in the correct column for you.

Skip the manual work

Describe it. Griddy does it.

Instead of writing this formula yourself, just tell Griddy what you need in plain English. Works in Excel and Google Sheets.

Use this on real templates

Use IFERROR inside real finance sheets

Error handling matters when lookup formulas, imported data, or summary blocks are powering sheets people actually review every week.

Finance