IFERROR(value, [value_if_error])One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
value:
The value or expression that you want to check for an error. This can be a cell reference, a formula, or a direct value.
value_if_error:
The value to return if the value results in an error. This can be a specific value, a formula, or a cell reference that defines what should be returned in case of an error.
The IFERROR function in Google Sheets is a useful tool that helps manage errors in formulas. It allows you to catch and handle errors gracefully, providing a way to display a custom message or an alternative result when an error occurs. This function is particularly helpful in ensuring that your spreadsheets remain clean and user-friendly, even when there are issues with the data or calculations.
In simpler terms, IFERROR helps you avoid displaying error messages like #DIV/0!, #N/A, or #VALUE! in your sheets, allowing you to present a more polished output.
Imagine you are calculating the average sales per product in a sales report stored in a Google Sheets document:
| ProductID | TotalSales | NumberOfSales |
|---|---|---|
| 101 | 500 | 10 |
| 102 | 300 | 0 |
| 103 | 450 | 15 |
You want to calculate the average sales per product. However, if the NumberOfSales is zero, it will result in a division error.
To achieve this, you would use the IFERROR function as follows:
=IFERROR(B2/C2, "No Sales")In this formula:
B2 is the cell containing the TotalSales.C2 is the cell containing the NumberOfSales."No Sales" is the value that will be returned if there is an error (like division by zero).When you apply the IFERROR formula to the Sales Data Table, the output would look like this:
| ProductID | TotalSales | NumberOfSales | AverageSales |
|---|---|---|---|
| 101 | 500 | 10 | 50.00 |
| 102 | 300 | 0 | No Sales |
| 103 | 450 | 15 | 30.00 |
In this case, for ProductID 102, the IFERROR function prevents a division error and instead displays "No Sales".
IFERROR is beneficial because it simplifies error handling in your spreadsheets. It allows you to provide clear, user-friendly messages instead of confusing error codes. This enhances the readability of your data and makes it easier for others to understand your calculations.
IFERROR is an essential function for anyone working with data in Google Sheets, providing a powerful way to enhance data presentation and usability.
Happy spreadsheeting!
You have a sales report where Column A lists product IDs and Column B shows sales figures. By using the IFERROR formula, you can display "Not Found" for any product ID that doesn't exist, ensuring clarity in your report without showing error messages.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.