In order to do this, we could nest our ‘ISERROR’ function within and ‘IF’ function.
For anyone not familiar with the ‘IF’ function, it simply consists of a logical test (in this case, our ‘ISERROR’ function) and the value we choose for it to return for either the true or false result of that logical test.
‘=IF(logical_test, [value_if_true], [value_if_false])’
So where the formula in cell C2 is currently ‘=A2/B2’, we will now substitute a new formula:
What this formula actually says that if our ‘ISERROR’ function returns ‘TRUE’, return the value ‘0’ but if it is false, return the result of the original mathematical calculation.