How to Use IFERROR in Excel to Stop Formula Errors

IFERROR catches an error from a formula and shows a cleaner fallback, such as a blank cell, zero, or message. It is useful once the formula is correct but some inputs may legitimately be missing.

Does this affect you?

Use this for Excel for Microsoft 365, Excel 2021, Excel 2019, and Excel for the web when formulas show #DIV/0!, #N/A, #REF!, or similar errors that should be handled gracefully.

Wrap a formula in IFERROR

IFERROR needs the formula to try and the value to show if it fails.

  1. Start with the formula that may error, such as =A2/B2.
  2. Place IFERROR around it.
  3. Add a fallback after a comma, such as “” for blank, 0 for zero, or “Check input” for text.
  4. Close the parenthesis and press Enter.
  5. Example: =IFERROR(A2/B2,””).
  6. Copy the formula down as needed.

When the calculation succeeds, Excel shows the normal result. When it errors, Excel shows your fallback instead.

Use IFERROR with lookups

Lookup formulas often return #N/A when no match exists.

  1. Start with a lookup formula such as =VLOOKUP(A2,Sheet2!A:B,2,FALSE).
  2. Wrap it as =IFERROR(VLOOKUP(A2,Sheet2!A:B,2,FALSE),”Not found”).
  3. Use a numeric fallback like 0 if the result will be totaled later.
  4. Fill the formula down.

More control

Use IFNA for missing lookups

IFERROR hides every error type. If you only want to catch missing lookup results, use IFNA so other problems, such as broken references, remain visible.

Nest fallback lookups

You can try one lookup first and another second, such as IFERROR(first lookup, IFERROR(second lookup, “Not found”)).

Do not hide errors while building

Add IFERROR after the formula is tested. During formula construction, seeing the original error code helps identify the real problem.

Temporarily remove the wrapper

If a result looks suspicious, remove IFERROR and inspect the raw error. #DIV/0!, #N/A, and #REF! point to different causes.

Sources

  • Microsoft Support – IFERROR function (2025)
  • Microsoft Support – Detect errors in formulas (2025)
  • Microsoft Support – IF function (2025)
Disclosure: This post may contain affiliate links which means I may receive a commission for purchases made through links. I will only recommend products that I have personally used! Learn more on my Private Policy page.
A thoughtful woman reads a newspaper while enjoying coffee at an indoor workspace.

DEALWEEK

SUBSCRIBE AND GET 20% OFF YOUR NEXT ORDER! OFFER ENDS SOON - DON’T MISS OUT!

We don’t spam! Read our privacy policy for more info.

Shopping Cart