How to Use ISERROR in Google Sheets
ISERROR is a Google Sheets function that helps you find out if a cell contains an error or not. It returns TRUE if the cell contains an error and FALSE if it doesn't. You can use ISERROR in combination with other functions to handle errors and display custom messages or values when an error occurs.
Here's how to use ISERROR in Google Sheets:
- Open your Google Sheets document or create a new one.
- Click on the cell where you want to use the ISERROR function.
- Enter the ISERROR function in the following format:
=ISERROR(value)
, wherevalue
can be a reference to another cell, a formula, or a value. - Press Enter to see the result. The cell will display TRUE if there's an error and FALSE if there isn't.
Example
Let's say you have a list of numbers in column A and you want to divide 100 by each number in column B. However, you want to avoid displaying an error in case there's a zero in column A.
- In cell B1, type the following formula:
=IF(ISERROR(100/A1), "Error", 100/A1)
- Press Enter to see the result. If A1 contains a zero, cell B1 will display "Error". Otherwise, it will display the result of 100 divided by the value in A1.
- Copy the formula in cell B1 and paste it to other cells in column B to apply the same logic for other rows.
In this example, we used the IF function together with ISERROR to check if dividing 100 by the value in column A would result in an error or not. If there's an error, we display "Error" in column B. If not, we display the result of the division.