Microsoft Office

Excel #DIV/0! Error: Stop Dividing by Zero or Blank Cells

Published ✓ Verified ⏱️ 2 min read October 16, 2025 · by Ryan Bennett

A formula displays #DIV/0! instead of a result.

Why: Excel shows #DIV/0! when a number is divided by zero (0). It happens with a direct formula like =5/0, but far more often because the formula refers to a cell that holds 0 or is blank — for example a not-yet-filled “units” cell in =Total/Units. An empty divisor counts as zero, so the division is undefined.

Fix 1: Make sure the divisor isn’t zero or blank

The cleanest fix is the data, not the formula. Check the cell in the denominator:

  1. Click the cell showing #DIV/0! and look at the formula bar to see which cell is the divisor.
  2. If that cell is blank or 0, enter the real value.
  3. If the value genuinely should be 0 (or stays blank until data arrives), use one of the formula fixes below so the sheet reads cleanly in the meantime.

Fix 2: Test the denominator with IF

Wrap the division in an IF that checks the divisor first. Written as =IF(A3, ...), Excel treats any non-zero, non-blank A3 as TRUE and does the math; a 0 or blank A3 is FALSE and returns your fallback.

Returns 0 when A3 is empty/zero:        =IF(A3,A2/A3,0)
Returns a blank cell instead:           =IF(A3,A2/A3,"")
Returns a custom message:               =IF(A3,A2/A3,"Input Needed")

This is the most surgical option — it only suppresses the result when the divisor is actually missing.

Fix 3: Catch it with IFERROR

If you want any error from the division to fall back to a value, nest it in IFERROR:

=IFERROR(A2/A3,0)

This returns 0 if the division errors, otherwise the normal result. Be aware IFERROR (and the older IF(ISERROR(...))) are blanket handlers — they suppress all errors, not just #DIV/0!. So confirm your formula is otherwise correct before wrapping it, or you may hide a real #REF! or #VALUE! behind a tidy zero.

FAQ

AVERAGE gives #DIV/0! on an empty range. AVERAGE divides by the count of numbers, and an all-blank range counts as zero items. Once at least one number exists the error clears; until then, guard it with =IFERROR(AVERAGE(B2:B10),0).

Should I show 0 or a blank? Use 0 when the value feeds further math (so totals still work). Use "" (blank) or a label like "Input Needed" when the cell is for people to read and a zero would be misleading.

The divisor cell isn’t blank but I still get #DIV/0!. It may contain a formula that itself returns 0, or a space that Excel reads as zero in division. Click into it and verify it holds a real non-zero number.

Sources: Microsoft Support — How to correct a #DIV/0! error · Microsoft Support — IFERROR function

↑↓ navigate · ↵ open · Esc close See all results →