IFERROR Function

IFERROR Function

IFERROR Function

Return a fallback value when a formula produces an error such as #DIV/0!, #N/A, or #VALUE!.

ExcelClash Team
PUBLISHED

Summary

The Excel IFERROR function returns one value when a formula works normally and a different value when that formula produces an error. It is commonly used to replace messages such as #DIV/0!, #N/A, or #VALUE! with something cleaner and easier to read.

IFERROR is useful in reports, dashboards, and helper formulas where a raw error code would distract the reader or break a later step. At the same time, it should be used carefully, because replacing every error can also hide problems that you may want to fix directly.

Purpose

Provide a fallback when a formula errors

Use IFERROR when a formula may fail and you want to show a controlled result instead of an Excel error code.

Return Value

Normal result or fallback value

If the original formula works, IFERROR returns that result unchanged. If it errors, IFERROR returns the fallback you provide.

Syntax

=IFERROR(value, value_if_error)

The first argument is the formula or expression to evaluate. The second argument is what Excel should return if the first argument produces an error. Microsoft notes that if either argument is an empty cell, IFERROR treats it as an empty string.

Arguments

  • value - [required] The formula, expression, or reference you want to evaluate.
  • value_if_error - [required] The value to return if the first argument produces an error.

The fallback can be text, a number, a blank, or even another formula. A numeric fallback such as 0 is often useful when the result will be used in later math.

IFERROR vs IFNA

These functions are similar, but they do not handle the same scope of problems.

Function Handles Best Use Main Tradeoff
IFERROR All Excel error types General fallback when any error should show a replacement Can hide issues you may want to investigate
IFNA #N/A only Lookup formulas where "not found" is the expected problem Other errors still show normally

If you only want to handle missing lookup matches, IFNA is usually more precise. If any error should trigger the same fallback, IFERROR is more convenient.

Using IFERROR

A common use of IFERROR is protecting division formulas. If a denominator might be zero or missing, wrapping the calculation with IFERROR lets you return 0, a blank, or a note such as "Check Input" instead of leaving an error in the sheet.

It is also very common around lookup formulas. When a missing match would confuse readers, IFERROR can return a cleaner label such as "Missing", "Guest", or "Not Available". That makes the output easier to understand, especially in user-facing reports.

The main caution is that IFERROR does not distinguish between harmless and serious errors. It treats a missing lookup, a broken reference, and a typo in a function name as the same kind of event. That is why it is often best to use IFERROR near the final presentation layer of a workbook, not as a way to ignore every problem during model building.

Example 1 - Replace a Division Error with 0

This is one of the most common IFERROR patterns.

=IFERROR(B2/C2,0)

If the division works, Excel returns the calculated value. If it produces an error such as division by zero, the formula returns 0 instead.

Check Answer
Challenge #1
Target: Sheet1!F1
Division Safety

In cell F1, return 0 if B2/C2 produces an error.

Example 2 - Return a Friendly Lookup Label

IFERROR can make lookup output easier to read.

=IFERROR(VLOOKUP(B2,D2:E5,2,0),"Guest")

If the lookup finds a match, the result is returned normally. If the lookup errors, the formula returns "Guest" instead of a raw error code.

Check Answer
Challenge #2
Target: Sheet1!F2
Lookup Protection

In cell F2, search for B2 in D2:E5 and return "Guest" if the lookup errors.

Example 3 - Show a Short Message

Sometimes the fallback should tell the reader what action to take.

=IFERROR(1/0,"Check Data")

Because 1/0 always errors, this example returns "Check Data". It shows how IFERROR can turn an error into a more useful instruction.

Check Answer
Challenge #3
Target: Sheet1!F3
Clean Text Result

In cell F3, return "Check Data" if 1/0 produces an error.

Example 4 - Keep a Result Numeric for Later Math

When the output feeds totals or summaries, a numeric fallback is often the safest choice.

=IFERROR(B2*C2,0)

If the multiplication works, the product is returned. If one part of the formula errors, the result becomes 0, which is often easier to handle in later calculations than a text label.

Check Answer
Challenge #4
Target: Sheet1!F4
Safe Product

In cell F4, multiply B2 by C2 and return 0 if the formula errors.

Conclusion Recap

  • Core idea: IFERROR returns a fallback when a formula produces any Excel error.
  • Best use: Cleaner presentation for formulas that may reasonably fail.
  • Flexible fallback: The replacement can be text, a number, a blank, or another formula.
  • Numeric tip: Use 0 when the result will feed other math.
  • Main caution: IFERROR can hide problems that deserve attention, not just harmless missing values.
  • More precise option: Use IFNA when you only want to handle #N/A.
Tactical Arena
Select Scenario:
Share IFERROR Function!

Tell your friends about this post

Discussion

ExcelClash is an interactive platform designed to level up your Excel skills through real-world exercises and challenges. Sharpen your logic, solve real spreadsheet problems, and learn faster.

© 2026 ExcelClash, Inc. All rights reserved.