#DIV/0!
A formula divided by zero, or by an empty cell.
- Excel error
- The fix is practised in 3 lessons
The error, and the fix
D2=B2/C2
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Rep | Revenue | Orders | Per order | Checked first |
| 2 | Marco | 0 | 0 | ||
| 3 | Lena | 1,800 | 12 | ||
| 4 | Ade | 950 | 5 |
Marco has no orders yet, so B2/C2 divides by zero. The second formula tests C2 before dividing.
Why it happens, and how to fix it
- The number you divide by is zero or empty
- With no orders yet, revenue ÷ orders has nothing to divide by; an empty cell counts as zero. Test it first: =IF(C2=0,"No orders",B2/C2).
- An average of nothing
- AVERAGE of cells with no numbers gives #DIV/0!. Check there is something to average: =IF(COUNT(B2:B6)=0,"No data",AVERAGE(B2:B6)).
- A divisor that moved when copied
- Copied down, B2/F1 becomes B3/F2, which may be empty. If every row divides by one cell, lock it: B2/$F$1.
Questions
How do I get rid of #DIV/0! in Excel?
Check the divisor before dividing: =IF(C2=0,"",B2/C2) leaves the cell blank until there is something to divide by. =IFERROR(B2/C2,"") also works, but it hides every other error too.
Why does AVERAGE give #DIV/0!?
None of its cells hold a number, so it would divide by a count of zero. Empty cells and text are not counted.
Practise the fix
Real tasks in a spreadsheet, checked on changed data, so your fix has to work on data you can’t see.
Practise it freeStop it happening
- Test the divisor with IF rather than wrapping everything in IFERROR, which also hides mistakes you would want to see.
- Show a blank or a short note when there is nothing to divide, not 0: a 0 looks like a real result.