Fixing #DIV/0! errors
The average order value is sales divided by orders. But Quinn has 0 orders, and dividing by 0 gives #DIV/0!.
keyboard Typing formulas is easiest on a computer with a keyboard.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Name | Sales | Orders | Average order | |
| 2 | Tariq | 182 | 7 | ||
| 3 | Nadia | 1540 | 22 | ||
| 4 | Daniel | 870 | 15 | ||
| 5 | Quinn | 0 | 0 | ||
| 6 | Jamal | 720 | 30 | ||
| 7 | Isla | 0 | 0 | ||
| 8 | Kofi | 805 | 23 | ||
| 9 | |||||
| 10 | |||||
| 11 | |||||
| 12 |
How IFERROR and IF works
What does #DIV/0! mean?
You divided by zero, or by an empty cell (Excel treats an empty cell as 0). An average order value with no orders yet is a typical example.
How do I show something else instead?
Wrap the division in
IFERROR:=IFERROR(B2/C2,"No orders")shows the answer when there is one, and your message when the division fails.Is
IFbetter?=IF(C2=0,"No orders",B2/C2)checks for the zero first. It only catches that one problem, so other mistakes (like text in a number column) still show their error.IFERRORhides every error, which is quicker but can hide a real mistake.Should I show 0 instead?
Only if 0 is true. An average of 0 looks like real data; a message or a blank (
"") makes it clear there is nothing to show yet.
Know someone fighting with a spreadsheet? Send them this page.