# Google Sheets IFERROR Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/iferror-function
- Author: Better Analyst

Formula Bot is now Better Analyst—same account, more powerful analysis.Formula Bot is now Better Analyst—same account and workflows, with more powerful analysis, dashboards, and automation.

[Learn what changed](https://betteranalyst.com/formula-bot-is-now-better-analyst)

The IFERROR function returns a specified value if a formula results in an error, otherwise it returns the formula's result.

```
IFERROR(value, [value_if_error])
```

Generate FormulaExplain Formula

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

Describe the IFERROR you need in plain EnglishGenerate Formula

## Parameters

**`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.

## What is the IFERROR Function?

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.

## A Practical Example

Imagine you are calculating the average sales per product in a sales report stored in a Google Sheets document:

### Sales Data Table:

| 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.

## IFERROR Formula

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).

## Result of the Formula

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".

## Why Use IFERROR?

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.

## Key Takeaways:

- **IFERROR**: A function that catches errors in formulas and allows you to return a custom message or alternative result.
- **Error Management**: Helps maintain a clean and professional appearance in your spreadsheets by avoiding error messages.
- **Common Use Cases**: Ideal for financial calculations, data analysis, and any scenario where errors may occur in formulas.

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!

## Example use case

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.

## Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

[Create Free Account](https://betteranalyst.com/signup)[Try Formula Generator](https://betteranalyst.com/excel-ai)

## Google Sheets how-to guides

- [How To Subtract In Google Sheets](https://betteranalyst.com/google-sheets/how-to-subtract-in-google-sheets)
- [How To Transpose Data In Google Sheets](https://betteranalyst.com/google-sheets/how-to-transpose-data-in-google-sheets)
- [How To Unhide Columns In Google Sheets](https://betteranalyst.com/google-sheets/how-to-unhide-all-columns-in-google-sheets)
- [How To Unhide Rows In Google Sheets](https://betteranalyst.com/google-sheets/how-to-unhide-all-rows-in-google-sheets)
- [How To Unprotect Google Sheets](https://betteranalyst.com/google-sheets/how-to-unprotect-google-sheets)
- [How To Wrap Text In Google Sheets](https://betteranalyst.com/google-sheets/how-to-wrap-text-in-google-sheets)
- [Google Sheets Conditional Formatting](https://betteranalyst.com/google-sheets/google-sheets-conditional-formatting)
- [How To Add A Column In Google Sheets](https://betteranalyst.com/google-sheets/how-to-add-a-column-in-google-sheets)

## Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

## Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

1. [01ChatGPTOpen a balanced comparison prompt in ChatGPT.](https://chatgpt.com/?prompt=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
2. [02ClaudeOpen the same research prompt in Claude.](https://claude.ai/new?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
3. [03PerplexityResearch the comparison with linked web sources.](https://www.perplexity.ai/search?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.
