
Return a fallback value when a formula produces an error such as #DIV/0!, #N/A, or #VALUE!.
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.
Use IFERROR when a formula may fail and you want to show a controlled result instead of an Excel error code.
If the original formula works, IFERROR returns that result unchanged. If it errors, IFERROR returns the fallback you provide.
=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.
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.
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.
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.
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.
In cell F1, return 0 if B2/C2 produces an error.
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.
In cell F2, search for B2 in D2:E5 and return "Guest" if the lookup errors.
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.
In cell F3, return "Check Data" if 1/0 produces an error.
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.
In cell F4, multiply B2 by C2 and return 0 if the formula errors.
IFERROR returns a fallback when a formula produces any Excel error.0 when the result will feed other math.IFNA when you only want to handle #N/A.Tell your friends about this post