IFERROR wraps any formula and swaps its error result for a value you choose, so a divide-by-zero, a broken lookup or a text-in-number calculation shows a blank, zero or friendly note instead of #DIV/0! or #N/A. The pattern is =IFERROR(your_formula, "what_to_show_instead"), and it works in Excel for Microsoft 365, Excel 2019 and later, Excel for the web, and the mobile apps. Nothing needs installing, but you should know which formula you are wrapping and what a sensible fallback looks like.
What You'll Need
- A version of Excel that supports IFERROR (Excel 2007 onward, including Microsoft 365 and Excel for the web). Older files saved as .xls in very old versions may not recognise it.
- The formula that is currently producing the error, working correctly on the rows where the data is complete.
- A decision about what to display when the formula fails: a blank
"", a zero, a dash, or a short text label such as"Check input". Pick one and use it consistently across the sheet. - Optional: a helper cell or named cell holding the fallback text, if you want to change it in one place later.
Step-by-Step
- Reproduce the error first. Find a cell showing an error code. Click it and look at the formula bar to see the real formula underneath. Note the code itself:
#DIV/0!,#N/A,#VALUE!,#REF!,#NAME?and#NUM!each point to a different cause, and IFERROR hides the symptom without fixing the cause. - Write the working formula in a spare cell. Copy the formula from the broken cell into an empty cell where the inputs are valid, to confirm it returns the right result there. Never wrap a formula you have not seen work at least once; you will just be hiding a bigger bug.
- Type the wrapper. In the target cell, enter
=IFERROR(, paste or retype your formula, add a comma, type your fallback value, then close the bracket. For example=IFERROR(A2/B2, "")or=IFERROR(VLOOKUP(A2, Sheet2!$A$2:$D$500, 3, FALSE), "Not found"). The comma separating the two arguments is essential; leaving it out gives a#VALUE!from the wrapper itself. - Choose the fallback carefully. Use
""when the cell is purely for display and you want it to look empty. Use0only when a zero genuinely means nothing was calculated, because downstream SUM and AVERAGE formulas will treat it as a real number. Use a text label when a human needs to know something is wrong. - Press Enter and copy down. Confirm the cell shows a real value on good rows and the fallback on bad rows. Drag the fill handle down, or copy and paste the cell across the range. Relative references adjust as normal; keep any lookup table ranges absolute with
$so they do not shift. - Test the fallback deliberately. Temporarily blank one input cell or change a lookup name to something that does not exist. The cell should show your fallback, not an error. Undo the change afterwards.
- Check what the fallback does to totals. If other formulas sum that column, a text fallback like
""is ignored by SUM while a text label causes SUM to return#VALUE!. Test the column total after wrapping, and switch to a numeric fallback or a helper flag column if the totals break. - Only then hide the original formula. Once you are happy, replace the original broken formula in every affected cell. Keep a copy of the unwrapped version in a comment or a scratch sheet while you work, so you can tell whether an error was ever real data.
Common Mistakes
- Hiding real problems. IFERROR catches every error type, including ones that mean a referenced sheet was deleted or a name is misspelled. If the fallback is
"", that breakage can sit in the file silently for months. - Missing comma or bracket.
=IFERROR(A2/B2 "")or an unclosed bracket returns an error from IFERROR itself, which confuses beginners. - Fallback text where numbers are expected. A column of
"Not found"strings will break SUM, AVERAGE and chart series. Use a numeric fallback or a separate status column. - Wrapping the wrong thing. Wrapping only part of a longer formula, such as the division inside a bigger expression, can leave the outer part erroring anyway.
- Using IFERROR to avoid fixing a lookup. A VLOOKUP returning
#N/Aoften means a typo, trailing space or a mismatch between text and number format. Fix the data where you can, then wrap for presentation. - Forgetting that IFERROR also catches user-made errors. If someone types text into a numeric column and the formula breaks, the fallback hides the input mistake rather than warning them.
Tips
- In Microsoft 365 and Excel 2021 onwards, IFNA is available and only traps
#N/A, letting other errors show through. That is safer for lookup columns. - Keep the fallback visually distinct: a light fill colour or a dash rather than a blank, so you can see at a glance which rows are failing.
- Store the fallback text in one cell and refer to it, for example
=IFERROR(..., $Z$1), so you can change the wording everywhere at once. - When debugging, temporarily remove the IFERROR to see the true error, then put it back. Reading the raw error code is the fastest route to the cause.
- For a count of how many cells are failing without changing the display, use
=SUMPRODUCT(--ISERROR(range))in a spare cell. It counts errors without altering any values. - If you are building a shared workbook, note in a cell comment why each IFERROR is there. A future editor will otherwise assume the fallback is the intended output.
Troubleshooting
The cell still shows an error after wrapping. Check the brackets balance and that the comma between the formula and the fallback is present. Also confirm the error is not coming from a different cell the formula depends on in a way you did not expect, such as a chart series or a conditional formatting rule based on that cell.
The wrapped formula will not accept my fallback. If the fallback contains commas or quotes, wrap it in double quotes and double any internal quotes: "Not found". If you are using a semicolon instead of a comma as a separator because of regional settings, that is correct for your setup; Excel accepts either, but not both in the same file.
Totals now show errors or zeros. Text fallbacks are being summed. Either switch the fallback to a number, wrap the total in its own IFERROR, or move the status into a separate column and leave the numeric column with only numbers or blanks.
IFERROR is not recognised at all. The file may be in a format or on a version too old to support it, or it may be typed with a localised function name in a file using English names. Check the function name matches your Excel language, and consider saving as .xlsx.
You cannot tell why something broke. Remove the wrapper temporarily, read the raw error code, fix the underlying reference or data, then wrap again. If the error was #REF! because a column was deleted, rebuild the reference rather than hiding it.
Frequently Asked Questions
What is the difference between IFERROR and ISERROR?
ISERROR returns TRUE or FALSE, so it needs to be paired with IF: =IF(ISERROR(x), fallback, x). IFERROR does the same job in one step and evaluates the formula only once, which is shorter and easier to read.
Does IFERROR work in Google Sheets?
Yes, Google Sheets supports IFERROR with the same two-argument structure, so formulas you write in Excel usually copy across without changes.
Can I wrap an entire row of formulas at once?
No, IFERROR wraps one formula per cell. Write it in the first cell and fill down or across; each cell evaluates its own wrapped formula.
Why does my cell show a blank when there is a real problem?
That is the fallback working as intended. If you used "", every error looks the same. Switch to a text label or a separate flag column so you can tell failing rows from empty ones.
Is IFERROR available in Excel for the web and mobile?
Yes, it works in Excel for the web and the Excel mobile apps. Menu labels and function-name localisation can differ slightly by version, device and region, but the syntax is the same.
Should I fix the error or wrap it?
Fix it if the error means missing or wrong data. Wrap it when the error is an expected outcome, such as a lookup for a name that may genuinely not exist, or a division where the divisor can legitimately be zero.