FormulaCraft

Fix the #DIV/0! error

Excel & Google Sheets

What #DIV/0! means

A #DIV/0! error means a formula is trying to divide by zero — or by a cell that is empty, which the spreadsheet treats as zero. Division by zero has no answer, so the cell shows the error instead.

Common causes

Example fix

Broken
=A2/B2
Fixed
=IFERROR(A2/B2, "")

When B2 is empty or zero, the cell shows blank instead of #DIV/0!.

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How to fix it

  1. 1Identify the divisor — the value to the right of the / sign or the second argument of a ratio.
  2. 2Decide what should appear when the divisor is zero or blank: a dash, a 0, or a blank cell.
  3. 3Wrap the division in IFERROR to substitute that value, e.g. =IFERROR(A2/B2, "").
  4. 4For a more precise guard, test the divisor first with IF: =IF(B2=0, "", A2/B2).
  5. 5If the blank is temporary because data is not entered yet, the error will clear on its own once a non-zero value arrives.

Stop hunting errors by hand.

Upload your spreadsheet and the Auditor flags every #DIV/0! and broken formula at once — or paste this one formula and get the fix explained.

Frequently asked

How do I hide #DIV/0! but keep the formula?

Wrap it in IFERROR, e.g. =IFERROR(A2/B2, ""). The division still runs; only the error display is replaced.

Why does AVERAGE show #DIV/0!?

AVERAGE divides the sum by the count of numbers. If the range has no numeric values, the count is zero and you get #DIV/0!.

Related formulas

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: