How to Use IFERROR in Excel
IFERROR catches a formula's errors and returns a value you choose instead. It is the cleanest way to keep a model tidy when a lookup misses or a division hits a zero. Used well it improves readability, but wrapping every formula by hand is slow, and overusing it can hide real problems. Here is how to use it correctly.
The IFERROR syntax
The function takes two arguments: =IFERROR(value, value_if_error). The first is the formula or value to evaluate, and the second is what to return if that first argument produces any error. For example, =IFERROR(A1/B1, 0) returns the division result normally, but returns 0 when B1 is empty or zero and would otherwise give #DIV/0!. You can return blank text with =IFERROR(A1/B1, "") or a message with =IFERROR(VLOOKUP(...), "Not found").
Wrap a formula in IFERROR
Adding IFERROR to an existing formula is a small but fiddly edit.
- Click the cell and press
F2to edit, or click into the formula bar. - Move the cursor to just after the
=sign and typeIFERROR(. - Go to the end of the formula and type a comma, then the fallback value, for example
, 0. - Close with a
)and pressEnter. The formula=VLOOKUP(A2,Data,2,0)becomes=IFERROR(VLOOKUP(A2,Data,2,0), 0).
When not to use IFERROR
IFERROR hides every error, not just the one you expected, so a genuine #REF! or a broken name can disappear behind a clean-looking zero. Add it only where you know the error is harmless, such as a lookup that may legitimately miss. If you only want to catch missing lookups, IFNA is safer because it traps just #N/A and lets real errors surface. Avoid wrapping a formula before you have confirmed it works without errors first.
Wrap and unwrap formulas with ModelMint
Error Wrap applies IFERROR to every selected formula at once, so you can protect a whole column without retyping. It also strips an existing IFERROR wrapper back off when you want to debug what was being hidden, which is the part that is most awkward to do by hand.
Error Wrap
Wrap selected formulas in =IFERROR(...) in one click, or strip an existing IFERROR wrapper back off without retyping.
Get ModelMint See how it worksFAQ
What is the syntax for IFERROR in Excel?
It is =IFERROR(value, value_if_error). The first argument is the formula to evaluate and the second is what to return if that formula produces any error, for example =IFERROR(A1/B1, 0).
What is the difference between IFERROR and IFNA?
IFERROR catches every kind of error, including #REF!, #DIV/0!, and #N/A. IFNA catches only the #N/A error and lets all other errors show. Use IFNA when you only want to handle missing lookups and still see real problems.
Why should I be careful with IFERROR?
Because it hides all errors, it can mask a genuine broken reference or a typo behind a tidy fallback value. Only wrap formulas where the error is expected and harmless, and make sure the formula works before you wrap it.