ProofDrill

#DIV/0!

A formula divided by zero, or by an empty cell.

The error, and the fix

What is each rep’s average order?

D2=B2/C2

RowABCDE
1RepRevenueOrdersPer orderChecked first
2Marco00
3Lena1,80012
4Ade9505

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.

Free with a free account

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 free

Stop 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.

Lessons

Other errors