Handling Error Values with IFERROR in Excel

Tap a step below to see it explained in order.

  1. Identify the formula that's producing an error

    Find the cell displaying an error such as #N/A or #DIV/0!.

  2. Wrap it in IFERROR

    Use a structure like =IFERROR(original formula, "value to show") around the existing formula.

  3. Example: using it with VLOOKUP

    Something like =IFERROR(VLOOKUP(A1,B:C,2,0),"Not found") displays "Not found" instead of an error when no match exists.

  4. Decide what value to display

    You can show a blank (""), a zero, or a custom message β€” whatever fits the situation.

  5. Why this is useful

    Left unhandled, error messages look unprofessional and can throw off other calculations, so wrapping them with IFERROR keeps your results table clean.

Cleaning up messy error messages

Formulas like VLOOKUP or a simple division frequently produce #N/A or #DIV/0! errors when a value is missing or a denominator is zero. Left as-is, these errors look unpolished and can break any downstream formula that depends on that cell. Wrapping the formula in IFERROR replaces the raw error with whatever text or value makes sense for your report.

Choosing what to show instead

What you display in place of the error depends on context β€” a blank string works well for a clean printed report, while a custom message like "Not found" is more informative in a working spreadsheet. Just keep in mind that IFERROR catches every type of error indiscriminately, so it can occasionally mask a genuine mistake in your formula rather than just a missing lookup value.

Frequently Asked Questions

Can IFERROR handle every type of error?

Yes β€” it catches #N/A, #DIV/0!, #VALUE!, and virtually every other error type regardless of the specific cause, replacing all of them with the same fallback value.

What if I want to know the exact cause of an error?

While debugging, temporarily remove the IFERROR wrapper to see the raw formula's result, or use a more specific function like IFNA if you only want to catch one particular error type.