How to fix the #DIV/0! error in Excel
What #DIV/0! actually means
Excel shows #DIV/0! when a formula divides by zero — or by
an empty cell, because Excel treats a blank as zero in arithmetic. The math
is undefined, so instead of a number you get an error, and every formula
that reads that cell inherits it. It is usually the least mysterious Excel
error: somewhere in the formula there's a division, and the denominator is
zero or blank. The real question is why it's zero, and the right
fix depends on the answer.
The most common causes
- A blank denominator — this month's data hasn't been
entered yet, so
=Revenue/Unitsdivides by an empty cell. - A formula copied down past the data — the first 40 rows are fine, rows 41+ divide by blanks and error out.
- Averaging nothing —
AVERAGE,AVERAGEIF, orAVERAGEIFSover a range with no matching numbers returns#DIV/0!, because an average is a sum divided by a count of zero. - A genuine zero upstream — a denominator that is computed elsewhere and legitimately hit zero. This one may be telling you something true about the model; don't paper over it before checking.
Step-by-step fix
- Find the denominator. Click the error cell and read the formula bar; the divisor is what matters. If it's another formula, Formulas → Trace Precedents follows the chain to the source.
- Decide: missing data or real bug? If zero just means "no data yet", the error is cosmetic and a guard is correct. If the denominator should never be zero, fix the upstream cell — don't hide it.
- Guard the division with IF.
=IF(B2=0, "", A2/B2)shows a blank until data arrives. This is the precise fix: it handles exactly the case you understood. - Use IFERROR sparingly.
=IFERROR(A2/B2, "")is quicker to type, but it swallows every error — a future#REF!,#VALUE!, or misspelled name in that formula will vanish into the same blank. A targetedIFon the denominator is the safer habit; wrapping whole formulas in blanketIFERRORis how real mistakes hide in shipped spreadsheets. - Sweep the sheet. F5 → Go To Special → Formulas → Errors selects every error cell at once, so you can fix a copied-down column in one pass.
Or let us find every one in seconds
Upload your workbook and we'll flag every #DIV/0! — and,
just as important, the error-masking IFERROR wrappers and
broken references hiding behind clean-looking cells.
More fixes: run a full spreadsheet audit · fix the #REF! error · fix circular references