Formulyo

Excel + Google Sheets · Deep guide

IFERROR in Excel: hide errors with a clean fallback

Errors such as divide by zero or not available make a report look broken, even when the cause is harmless, like an empty row. IFERROR lets you decide what to show instead, for example zero or a short message.

IFERROR works in Excel 2007 or later and in Google Sheets. In this guide you will see how it works, a division example with real numbers and the cases where hiding an error is a bad idea. See also: VLOOKUP guide and SUMIF guide.

How IFERROR works

IFERROR takes two arguments: the formula that may fail and the value to show if it fails. Write it like this:

=IFERROR(A2/B2,0)

If the division works, Excel shows the result. If it fails, because the divisor is zero or empty, Excel shows 0 instead of an error. Works in Excel 2007 or later.

Step by step example

  1. Type a numerator in A1 and a divisor in A2.
  2. Click an empty cell, for example C1.
  3. Type =IFERROR(A1/A2,0) and press Enter.
  4. Change A2 to 0 and see how the result becomes 0.
AB
1Numerator (A)Divisor (B)
2104
350

With 10 and 4 the result is 2.5. With a divisor of 0 the result is 0 instead of an error. Use a short message such as none when 0 could be mistaken for a real value.

Common errors

  1. IFERROR hides every error, including real mistakes such as a wrong sheet name. Use it only around the formula that can fail.
  2. You show 0 where a blank would be clearer, and totals become misleading. Choose the fallback with care.
  3. You wrap a whole report in IFERROR and lose the signal that something is broken.
  4. The fallback is text but later formulas expect numbers, and they fail in turn.

A good rule is to fix the cause when you can and use IFERROR only when an error is expected, for example a lookup that may not find its key. Test with an empty row to confirm the fallback appears.

The same formula in other languages

Get 1 formula a day, free

Plus a free weekly planner template for Excel and Google Sheets. Unsubscribe in 1 click.

✓ Done! Check your inbox to confirm.

Want ready-made templates? See the Formulyo pack →

Keep learning