🟩 Sheet Formulas
#DIV/0!

#DIV/0! Error in Google Sheets

What it means: The formula tried to divide by zero or by a blank cell, which is mathematically undefined.

Quick fix

=IFERROR(A2/B2, 0)

Return 0 (or any value you choose) instead of the error when the divisor is zero or blank.

Why you see #DIV/0! — and how to fix each cause

1. The divisor cell is empty or zero

=A2/B2 errors when B2 is blank or contains 0, because dividing by nothing has no answer.

Fix: Guard the division with IFERROR, or check the divisor first with IF.

=IF(B2=0, "", A2/B2)

2. AVERAGE over an empty range

AVERAGE of a range with no numbers divides by a count of zero and returns #DIV/0!.

Fix: Wrap AVERAGE in IFERROR, or make sure the range has at least one number.

=IFERROR(AVERAGE(A2:A100), 0)

3. Percentage change from a zero baseline

=(new-old)/old fails when the old value is 0.

Fix: Trap it: return a blank or "n/a" when old is 0.

Before and after

BrokenWorking
=A2/B2 (B2 is empty) =IFERROR(A2/B2, 0)

IFERROR keeps your sheet readable by turning the error into a number you control.

How to stop it happening again

Whenever a formula divides by a cell that a user fills in later, wrap it in IFERROR or an IF(divisor=0,...) guard from the start. That keeps totals and charts clean before the data arrives.

FAQ

Should I use IFERROR or IF for #DIV/0!?

IFERROR is shortest and catches all errors. Use IF(divisor=0,...) when you want to catch only the zero case and let other errors surface.

Why does AVERAGE give #DIV/0!?

Because the range has no numeric values, so it divides the total (0) by a count of 0.