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.
- Start with the formula that may error, such as =A2/B2.
- Place IFERROR around it.
- Add a fallback after a comma, such as “” for blank, 0 for zero, or “Check input” for text.
- Close the parenthesis and press Enter.
- Example: =IFERROR(A2/B2,””).
- 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.
- Start with a lookup formula such as =VLOOKUP(A2,Sheet2!A:B,2,FALSE).
- Wrap it as =IFERROR(VLOOKUP(A2,Sheet2!A:B,2,FALSE),”Not found”).
- Use a numeric fallback like 0 if the result will be totaled later.
- 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)
