IFERROR Function in Excel

If you just need to iferror function in excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

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!.

On this page8

Syntax

=IFERROR(value, value_if_error)

Arguments

Argumentrequired / optionalDescription
valuerequiredThe expression or formula to evaluate, such as a VLOOKUP that might fail.
value_if_errorrequiredWhat to return when value produces any error; often "" for a blank or friendly text.

Related functions

IFVLOOKUPXLOOKUP
▤Annotated stepsExcel
1

Write the formula you want to protect, for example =VLOOKUP(E2, A2:B100, 2, FALSE).

2

Wrap it: type =IFERROR( in front and add a comma right after the closing bracket of that formula.

3

After the comma, type the fallback — text in quotes, "" for blank, or 0 for a number.

4

Close the IFERROR bracket and press Enter.

5

Fill the formula down the column so every row is protected.

Ctrl+CthenCtrl+Shift+V⌘+Cthen⌘+Ctrl+VPaste values · WindowsMac

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 outcome you expected 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. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.

In Google Sheets

The standard worksheet functions used by this example are listed in Google Sheets. Check the cell references, argument separators and input types in the target spreadsheet, then compare the worked result. This formula-availability check does not establish identical menus, keyboard shortcuts or workbook features, and it is not a product execution test. Nothing on this page is behind a login or a download: the exact answer is at the top, and the detail below it is there for when you need it. That is the whole promise here — the answer first, and just enough context to make it stick. For “iferror function in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.

Common mistakes

  • Using IFERROR to 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/A alone use IFNA so 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.

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.