ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 37 · Logic

IFERROR in Excel

IFERROR catches errors and shows something nicer instead. =IFERROR(C2/B2,0) shows 0 instead of #DIV/0! when B2 is empty.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Know what common errors mean
  • Show a friendly answer instead of an error

How it works

You can't divide by zero. If you try, you get #DIV/0!.

IFERROR(formula, backup) shows the backup answer when there's an error. Use it when you know an error might happen.

Formulas at a glance

=IFERROR(C2/B2, 0)0 instead of #DIV/0!

Example

Write the formula to find Alpha's revenue per unit (money made for each one sold). Show 0 if there are no units.

ABCD
1ProductUnitsRevenuePer unit
2Alpha40$1,200.00
3Beta0$0.00
4Gamma25$1,875.00
5Delta0$350.00
6Echo16$640.00
7
8Total

Click D2 and type =IFERROR(C2/B2,0), then press Enter.

The answer is $30.00.

When to use it

  • Dividing when some cells might be 0
  • Lookups that might not find a match
  • Keeping reports clean for other people

Common mistakes

  • Hiding mistakes you should fixUse IFERROR only for errors you expect.
  • Putting the backup firstThe formula goes first, the backup answer second.
  • Forgetting the closing parenthesisWrap the whole formula: =IFERROR( … , 0).

Quick check

Which error means you divided by zero?

  1. #N/A
  2. #DIV/0!
  3. #VALUE!
  4. #REF!
Show the answer

B. #DIV/0! DIV means divide.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

IFERROR in Excel: how it works, with examples · ExcelUnpack