Skip to content
Blog/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.

Do this with AI

Try Griddy free

Start in your browser. Also works with Excel and Google Sheets.

By Justin Freels//5 min read

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

Use IFERROR narrowly

IFERROR catches any error produced by its first argument, not just the error you had in mind. A broad wrapper can hide a misspelled range, a broken reference, a bad data type, or a genuine business exception. First diagnose the expected failure; then use IFNA for a not-found lookup or a more specific test when other errors should remain visible.

Choose a fallback that a reviewer can interpret: an empty string for an intentionally blank display, “Not found” for a missing key, or a visible review label when the source needs attention. Test both a valid row and each expected failure mode. Keep the original input available so a clean-looking report does not erase the reason a value was missing.

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.

Sources

Do this with AI

Turn the instructions into a finished spreadsheet.

Tell Griddy what you need in plain English, then inspect and keep editing the result in the browser, Excel, or Google Sheets.

Try Griddy freeStart in your browser. No download required.
Also works withExcel 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