Extend IFERROR() a little
When using IFERROR(), one traps ALL errors and has one method for handling them. For instance, IFERROR(A1/B1,"") places a blank in the cell if the divide by zero error occurs. Great. But it actually does that for ALL errors, not just divide by zero. One might want to do other things for other errors, or at the very least, know a different error occurred.
Of course, one can craft a different formula with IF() and check for whichever or all possible error conditions, but the point of this forum is making life easier and more straightforward.
I propose adding functionality to IFERROR() by allowing one to place a series of "do this" expressions for each of the possible errors Excel can generate, and of course, allowing some or all but one to be unspecified in which case it would return the actual error (so one could see what is going wrong and address it there or elsewhere). It might look like this:
=IFERROR( condition to evaluate, do this if #DIV/0!, do this if #VALUE!, do this is #REF!, do this if... etc. )
and one might only wish to provide a handler for #DIV/0! and #VALUE! and to actually see the other errors and so might write:
=IFERROR( A1/B1,"","Enter numerals only!",,,,,,,)
The author would then see a blank cell for a divide by zero error but all the others would show the actual error.
The main ideas are to allow different handling of chosen errors and to preserve the aid to troubleshooting given by any unexpected errors. (Not to mention showing the fact that unexpected errors actually occurred rather than hiding that fact from the author.)
Sergei Baklan commented
Other words some equivalent of
Yes, why not.
Excel Help commented
Love this suggestion. It's the reason I sometimes avoid IFERROR and construct my own error checking.