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. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “iferror function in excel”. Start on a copy or a tiny sample, keep the affected formula visible, and compare the result with the tool above before you touch the real workbook. 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. The point is a workflow that saves repeating the same clicks every week, but the practical win is that someone else can open the file and understand what happened without asking you.
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. If there is any chance you will reuse this, drop it into a small template tab right now: a labelled input area on the left and the formula beside it, checked once against the tool above. Next time the same question comes up, the answer is a single paste away instead of a rebuild from memory.
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. Nothing on this page is behind a login: the tool runs entirely in your browser, the formula is shown in full with one-click copy, and the steps work the same on Windows and Mac. That is the whole promise here — the exact answer, a way to prove it on your own numbers, and just enough context to make it stick. Treat “iferror function in excel” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.
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 function in excel” and “how to use the iferror function in excel”, among other phrasings; whichever wording you used, the fix above is the one you want.
This guide also answers
- excel iferror formula
Why do people search for this in so many different ways?
Because the same task has many names. “how to use iferror function in excel”, “how to use the iferror function in excel” all point at the one operation explained on this page, which is why they all lead here.