Checks if the value given as first argument is any type of error. If it is an error, the second argument is used as value. If it is not an error, the cell will be filled with the value given as first argument.
Iferror syntax
=IFERROR(Value
, Value if error
)
Argument | Argument description | |
---|---|---|
1 | Value | The value that is checked to be an error. If it is not an error, this value will be returned. |
2 | Value if error | The output that will be returned by Excel if the first argument is an error. |
Explanation
Calculating the ratio between two things requires dividing the two things. In this case, dividing the number of chairs by the number of people to get the chairs per person ratio. If we have 0 people, we end up dividing by 0. Dividing by 0 is not allowed in mathematics, so Excel shows an error.
Then, we use IFERROR to change the value of the cell to 0 if this error is shown. This way, the errors will not perpetuate throughout the workbook.
Questions
No, there is not. However, you could copy the formula in the answer below to accomplish the same thing.
Yes, although there is no function in Excel to do this, you can create your own formula. You could use something like: =IF(ISERROR(A1), "Error detected", "No error here")
This formula checks cell A1 for errors. If there is an error, the value will be “Error detected”. If there is no error, the value will be “No error here”. We have also made an IFNOTERROR exercise, where you can try this for yourself.
#DIV/0, #N/A, #REF, #VALUE, #NUM, #NAME and #NULL.