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.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Product | Units | Revenue | Per unit |
| 2 | Alpha | 40 | $1,200.00 | |
| 3 | Beta | 0 | $0.00 | |
| 4 | Gamma | 25 | $1,875.00 | |
| 5 | Delta | 0 | $350.00 | |
| 6 | Echo | 16 | $640.00 | |
| 7 | ||||
| 8 | Total |
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?
#N/A#DIV/0!#VALUE!#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.