How to Use IFERROR Function in Excel
Table of Contents
The IFERROR function in Excel is a logical function that allows you to handle errors in your worksheet by providing an alternative value or message. The IFERROR function checks if an error occurs in a formula and returns a specific value if an error occurs or the result of the formula if no error occurs.
Here’s how to use the IFERROR function in Excel:
First Select the cell where you want to display the result of the function.
Type the following formula into the cell: =IFERROR(formula,value)
In place of “formula,” enter the formula that you want to check for errors.
In place of “value,” enter the value that you want to display if an error occurs in the formula.
Press enter.
Here’s an example of how to use the IFERROR function:
Suppose you have a list of numbers, and you want to divide each number by a divisor. However, some of the divisors are zero, which causes a #DIV/0! error to appear. You can use the IFERROR function to handle this error by displaying a message instead of the error.
Select a cell where you want to display the result of the function.
Type the following formula into the cell: =IFERROR(B2/C2,”Divisor cannot be zero”)
This formula divides the number in cell B2 by the divisor in cell C2. If the divisor is zero, the IFERROR function will return the message “Divisor cannot be zero” instead of the #DIV/0! error.
Copy the formula to the other cells in the column to apply the same logic to each number and divisor.
Note that in the above example, we assumed that the numbers are in column B and the divisors are in column C. You will need to modify the formula to suit your specific situation.