Fix #DIV/0! in Google Sheets (divide by zero or a blank divisor)
#DIV/0! is division with a divisor of zero. A blank divisor counts as zero. The numerator can be fine. The formula parsed. Sheets will not divide by zero.
Recreate it on a blank sheet
Section titled “Recreate it on a blank sheet”- Open a blank spreadsheet. In A1 type
qty, B1days, C1per_day. A210. B20. - In C2 enter
=A2/B2. The cell shows#DIV/0!. The tooltip is Function DIVIDE parameter 2 cannot be zero. - In A3 type
10. Leave B3 empty. In C3 enter=A3/B3. The cell shows#DIV/0!again. A blank cell is zero in arithmetic. - In A4 type
10. B45. In C4 enter=A4/B4. The cell shows2. That row is the control: same formula, nonzero divisor, no error.
Leave C2 and C3 as the broken formulas.
What is actually wrong
Section titled “What is actually wrong”=A2/B2asks for 10 ÷ 0. That is undefined, so the cell is#DIV/0!.- B3 is empty. Empty is zero in this calculation, so
=A3/B3is the same error. You do not need to type a0. - This is not
#N/A. Nothing is being looked up. See what #N/A means. - This is not
#REF!. The references A2 and B2 still exist. See after you delete. - This is not a Formula parse error. The slash is valid. A parse error is
#ERROR!from argument separators. See locale parse error.
AVERAGE on a range with no numeric values can also land as #DIV/0! (it divides a sum by a count of zero). The recreate above is the slash form you actually type. Same error value.
Guard the divisor. Do not change C2 or C3.
Zero and blank together. In Sheets, a blank cell equals 0 in B2=0, so one test covers both broken rows. In D1 type if. In D2 enter =IF(B2=0,"",A2/B2). The cell is empty. Copy D2 down to D3. D3 is empty. In D4 enter =IF(B4=0,"",A4/B4). The cell shows 2.
If you want a label instead of a blank: =IF(B2=0,"n/a",A2/B2) returns n/a on the zero and blank rows.
IFERROR. In E1 type iferror. In E2 enter =IFERROR(A2/B2,""). The cell is empty. That works for this error and also hides #REF!, #N/A, and #NAME? if the formula later breaks in a different way. Use it only when any error should look like “no result.” Prefer the IF on the divisor when you care which error you are catching.
Fix the input. If B2 should never be zero, put the real day count in B2. C2 becomes a number and you do not need a wrapper. The wrapper is for rows where zero or blank is expected (a sku with no days yet, a template row, an unused line).
Do not wrap a divide you have not looked at. If B2 is a formula that should have returned 5 and returned 0, fix that formula. IF will not.