IFERROR function
IFERROR displays a fallback when a calculation returns an error.
Logical
Where can you use it?
Teams building reports and business rules. Adapt the example’s decision rule when you need to test a condition or display different results based on it.
Scenario in the workbook
Calculate a unit ratio. Show a review flag when the divisor is zero.
A worked example from the workbook
| Row | A | B |
|---|---|---|
| 6 | Value | Comparison |
| 7 | 10 | 2 |
| 8 | 5 | 5 |
| 9 | 1 | 0 |
=IFERROR(A7/B7,"Review")Expected result5
See the inputs and instructions for all 3 examplesCopyable formulas
=IFERROR(A2/B2,"Could not calculate")=EĞERHATA(A2/B2;"Hesaplanamadı")Sample data
Enter the headers and sample records in A1:B4.
| Total | Quantity |
|---|---|
| 120 | 4 |
| 100 | 0 |
| 90 | 3 |
Fill down through C4.
Enter the formula in C2.
To try the Turkish formula, use the sample data on the Turkish page.
Expected result
30, Could not calculate, 30
How it works
The second row shows the fallback instead of a division-by-zero error. Other error types can produce the same fallback. To diagnose an error, check the inner A2/B2 calculation in a separate cell.
Syntax
IFERROR(value, value_if_error)
Compatibility
Excel for Microsoft 365 and Excel 2016, 2019, 2021, and 2024.
Related pages
Worked examples
Calculate a unit ratio. Show a review flag when the divisor is zero.
Open the English sheet. Inputs begin at A6. F7:F9 show the live results and G7:G9 show the original results for comparison.
| Row | A | B |
|---|---|---|
| 6 | Value | Comparison |
| 7 | 10 | 2 |
| 8 | 5 | 5 |
| 9 | 1 | 0 |
| Case | Formula | Expected result |
|---|---|---|
| Record 1 | =IFERROR(A7/B7,"Review") |
5 |
| Record 2 | =IFERROR(A8/B8,"Review") |
1 |
| Record 3 | =IFERROR(A9/B9,"Review") |
Review |