IFERROR is a helpful function in Google Sheets that can be used when entering calculations into spreadsheet cells. IFERROR allows the user to specify a value for the cell to return if a calculation results in an error; this can help to prevent errors from crashing the entire spreadsheet, or it can hide errors from users who are viewing the sheet. The IFERROR function must be entered into the cell followed by the calculation you want performing, and then the value you want returning if there is an error. For example, entering IFERROR(C3+D3,”NULL”) will return “NULL” if there is an error during the calculation of C3+D3, but otherwise, it will enter the calculated value into that cell. IFERROR provides a useful way to check for and catch errors in your spreadsheets without disrupting your workflows.
IFERROR Function Syntax
IFERROR(value, [value_if_error])
- Value – function argument that will be checked for errors. Here you can pass both the whole formula and some cells.
- Value_if_error – replaces the error code. It’s optional, but it’s handy for tracking down types of errors, preventing crashes, and hiding the technical details of your table. If the parameter is not passed to the formula, IFERROR will return an empty string.
IFERROR can receive different types of errors: #N/A, #REF!, #DIV/0!, #VALUE!, #NUM!, #NAME? and #ERROR! We already wrote about all of them earlier in this article, along with details that should help fix these errors.
IFERROR Function Examples
The simplest example – we are trying to divide any number by 0, which is mathematically invalid. Google Sheets will return a #DIV/0! error, but if you use the IFERROR function, you can specify a different answer. For example, error.
A slightly more complicated option – we want to find among the students those who passed the test with 100 points. However, no one got the maximum score and the search function gives an error. With IFERROR, you can make the result more pleasing to the eye. In our example “Not in List”.
Conclusion
It’s important to note that the IFERROR function will remove any type of error message or values—regardless of what they are. If desired, the function can simply replace them. This is your backup plan in case something goes wrong so that all the calculations in the document do not collapse, which are tied to this formula. In case of an error, you can simply set the value to 1, so everything will continue to work.