0Pricing
Excel Formulas Academy · Lesson

Catching Errors With IFERROR

Replace any error with a fallback value using IFERROR.

Catching Errors With IFERROR is a free Excel Formulas Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Excel Formulas Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Meet IFERROR

The IFERROR function is your all-purpose safety net. It checks whether a formula produces any error, and if it does, it shows a friendly value you choose instead.

This keeps your spreadsheet looking clean and professional. Instead of scary codes like #DIV/0! scattered across a report, you see helpful text such as a blank or a dash.

In this lesson you will learn the IFERROR syntax and how to apply it to real formulas.

The IFERROR Syntax

IFERROR takes exactly two arguments:

  • value the formula or calculation to try
  • value_if_error what to show if that formula errors

The pattern is =IFERROR(your_formula, fallback). The spreadsheet runs your formula first. If it works, you see the real answer. If it errors, you see the fallback instead.

=IFERROR(A2/B2, 0)

Replacing a Division Error

Recall that dividing by an empty cell gives #DIV/0!. Wrapping the division in IFERROR fixes the display.

Here, if B2 is zero or blank, the formula returns 0 instead of the error. If B2 has a real number, the normal division runs.

You could also return a blank by using two quotation marks, "", as the fallback.

=IFERROR(A2/B2, "")

Friendly Lookup Messages

IFERROR shines with lookups. A VLOOKUP that finds no match returns #N/A, which can confuse readers.

By wrapping the lookup, you can replace that with a clear message like "Not found". Now anyone reading the sheet understands the result instantly.

This single technique makes lookup-heavy reports far easier to trust and share.

=IFERROR(VLOOKUP(A2,Data!A:B,2,FALSE), "Not found")

Returning a Different Calculation

The fallback does not have to be plain text. It can be another formula to run when the first one fails.

For example, if a primary lookup misses, you can fall back to a secondary lookup in a different table. The spreadsheet tries the first, and only on error does it try the second.

This lets you chain attempts gracefully without ugly errors in between.

=IFERROR(VLOOKUP(A2,Main!A:B,2,0), VLOOKUP(A2,Backup!A:B,2,0))

IFERROR Catches Everything

An important feature: IFERROR catches every error type. It does not matter whether the formula throws #DIV/0!, #N/A, #VALUE!, or #REF! the fallback is shown for all of them.

This is powerful but also a warning. Because it hides every error, IFERROR can mask real problems you would rather know about.

If you only want to hide missing lookups, IFNA is a safer choice, which you will learn next lesson.

A Sales Report Example

Suppose you calculate growth percentage as this period minus last period, divided by last period. If last period is zero, you get #DIV/0! for new products.

Wrapping it in IFERROR with the text "New" turns those errors into a meaningful label. Established products show a real percentage; brand new ones show New.

The report now reads cleanly from top to bottom.

=IFERROR((B2-C2)/C2, "New")

Do Not Hide Too Much

Because IFERROR is so broad, be careful where you place it. If you wrap an entire complicated formula, a #VALUE! error caused by bad data could be silently replaced.

You might then trust a number that is actually wrong. The best practice is to wrap the specific part most likely to error, not the whole calculation.

Use IFERROR deliberately, and during testing remove it temporarily to confirm your formula really works.

IFERROR With Empty Results

A common style choice is to return an empty string for missing data so the cell simply looks blank.

Using "" as the fallback keeps charts and totals tidy, since most functions treat blank-looking text as nothing visible.

Be aware though: a cell holding "" is technically text, not truly empty, which can affect some COUNT or chart behaviors. For totals it is usually safer to return 0.

=IFERROR(SUMIFS(Sales,Region,A2), 0)

When to Reach for IFERROR

Use IFERROR when you want a single, simple safety net over a formula and you are confident any error is expected and harmless.

Great cases include division ratios, optional lookups, and growth calculations on new items.

Avoid it when you need to know about unexpected errors, or when only one specific error type should be handled. For lookups specifically, IFNA gives finer control, coming up next.

Nesting IFERROR Safely

You can place one IFERROR inside another to try several fallbacks in order. The spreadsheet tries the first formula, then the second, then a final default.

Here it looks in the main table, then a backup table, and if both miss it returns "Not found". Each layer only runs when the previous one errors.

Keep nesting shallow, two or three levels at most, or the formula becomes hard to read and maintain.

=IFERROR(VLOOKUP(A2,Main!A:B,2,0), IFERROR(VLOOKUP(A2,Backup!A:B,2,0), "Not found"))

Quick Check

Test your understanding of IFERROR.

Recap: IFERROR

You learned the all-purpose error handler:

  • =IFERROR(value, value_if_error) tries a formula and shows a fallback if it errors.
  • It catches every error type, so use it deliberately.
  • The fallback can be text, a number, a blank "", or even another formula.
  • Wrap the risky part, not the whole calculation, so real problems stay visible.

Next you will meet IFNA, which targets only the #N/A lookup error.

Frequently asked questions

Is the “Catching Errors With IFERROR” lesson free?

Yes — the full text of “Catching Errors With IFERROR” is free to read here on the web, and the Excel Formulas Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Excel Formulas Academy course, upgrade to CoddyKit PRO.

What will I learn in “Catching Errors With IFERROR”?

Replace any error with a fallback value using IFERROR. You practise Excel Formulas Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Excel Formulas Academy?

No prior experience is required. Excel Formulas Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Catching Errors With IFERROR” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Excel Formulas Academy lesson?

Yes. Every Excel Formulas Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Understanding Error Types
  2. Catching Errors With IFERROR
  3. Targeting Missing Lookups With IFNA
  4. Detecting Problems With ISERROR
← Back to Excel Formulas Academy