Excel IFERROR Formula: Handle Formula Errors Carefully
IFERROR can make a report easier to read when a known error has an appropriate fallback. First understand which errors the formula might produce.
What to do
- Wrap the calculation in IFERROR and choose a fallback that makes sense to people using the result.
- Use the example to handle a zero denominator, and keep missing or invalid source data distinguishable where it matters.
- Test both valid and error-producing inputs so you can confirm the fallback is only shown in the intended cases.
- If only lookup-not-found errors need handling, consider IFNA so unrelated errors remain visible.
Checks and limitations
- IFERROR can suppress many different errors, including errors caused by incorrect references or data.
- A zero fallback may be misread as a real measurement; use a clear label or blank only when appropriate.
What IFERROR does
Use IFERROR to show a chosen fallback when a formula returns an error, while preserving valid results.
Syntax
=IFERROR(value, value_if_error)
Copyable formula
=IFERROR(A2/B2,0)Example result: 0 when B2 is zero.
Example data
| Numerator | Denominator | Result |
|---|---|---|
| 12 | 3 | 4 |
| 8 | 0 | 0 (fallback) |
| 15 | 5 | 3 |
Real-world use
Avoid a visible divide-by-zero error in a report while keeping successful calculations intact.
Common mistakes
- Using IFERROR to hide every error without checking why it occurred.
- Returning zero when a blank or missing value should remain visibly distinct.
Alternative formulas
IFNA handles only #N/A. An explicit IF test can handle known conditions such as a zero divisor.
Compatibility
IFERROR is available in current Excel versions; check older spreadsheet software when sharing workbooks.
Frequently asked questions
Does IFERROR catch every formula error?
It returns the fallback for an error in the value expression, so it can hide errors beyond the one you expected.
When should I use IFNA instead?
Use IFNA when only a missing lookup result should be handled and other errors should remain visible.
Browse the Excel formula library ยท Open the percentage calculator