In Excel: use =IFERROR(value, value_if_error) — it runs a formula and returns your fallback instead of any error message like #N/A, #DIV/0! or #VALUE!.
Syntax
Arguments
| Argument | Description | |
|---|---|---|
value | required | The expression or formula to evaluate, such as a VLOOKUP that might fail. |
value_if_error | required | What to return when value produces any error; often "" for a blank or friendly text. |
Related functions
IF(SUMIFS(C2:C100, A2:A100, "West") > 1000, "On target", "Below")Tests a condition: returns the 2nd argument if true, the 3rd if false.SUMIFS(C2:C100, A2:A100, "West") > 1000The left side is greater than the right side.SUMIFS(C2:C100, A2:A100, "West")Adds the cells that match every listed condition.C2:C100A reference to cells in your sheet.A2:A100A reference to cells in your sheet."West"A fixed value typed directly into the formula.1000A fixed value typed directly into the formula."On target"A fixed value typed directly into the formula."Below"A fixed value typed directly into the formula.What this does
IFERROR wraps a formula so that if it produces an error of any kind — #N/A, #DIV/0!, #VALUE!, #REF!, #NAME?, #NUM! or #NULL! — Excel shows a clean fallback you choose rather than the cryptic error code. If the formula works, its normal result comes through untouched. The classic use is wrapping a VLOOKUP so missing keys show blank or a message instead of #N/A cluttering the sheet. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. Treat “excel iferror formula” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected formula shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a workflow that saves repeating the same clicks every week into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
A VLOOKUP for the SKU in E2 may not find a match: =IFERROR(VLOOKUP(E2, A2:B100, 2, FALSE), "not found"). When the SKU exists it returns the price, say 19.99; when it is missing it returns "not found" instead of #N/A. To leave the cell blank instead, use "" as the second argument: =IFERROR(VLOOKUP(E2, A2:B100, 2, FALSE), ""). Reach for IFERROR to keep reports clean: it turns ugly error codes into blanks or plain-language messages, which matters most around lookups and divisions that can legitimately fail. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. The short version of “excel iferror formula”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.
Common mistakes
- Using
IFERRORto hide a genuine mistake — it masks#REF!or#VALUE!that signal a broken formula, so confirm the formula is correct before wrapping it. - Catching every error when you only meant to handle a missing lookup; for
#N/Aalone useIFNAso real errors still surface. - Putting the fallback first — value comes first and value_if_error second, never the other way around.
Frequently asked questions
What is the difference between IFERROR and IFNA?
IFERROR catches every error type, while IFNA catches only #N/A and lets other errors like #DIV/0! show through. Use IFNA for lookups when you still want to see genuine calculation errors.
How do I make a cell blank when a formula errors?
Use "" (two double quotes) as the second argument: =IFERROR(your_formula, ""). The cell looks empty, though it still contains a formula rather than being truly blank.
Does IFERROR slow down my workbook?
IFERROR evaluates value once and only uses the fallback on error, so the overhead is tiny. The bigger cost is the wrapped formula itself, not the IFERROR around it.
Other ways people ask this
People reach this page typing “how to use iferror in excel” and “formula iferror excel”, among other phrasings; whichever wording you used, the fix above is the one you want.
Why do people search for this in so many different ways?
Because the same task has many names. “how to use iferror in excel”, “formula iferror excel” all point at the one operation explained on this page, which is why they all lead here.