Fix the #DIV/0! Error
A rate, average, or percentage column shows #DIV/0! — usually in rows where the denominator hasn't been filled in yet.
Excel & Google Sheets
This formula works in both Excel and Google Sheets.
How it works
Dividing by zero is undefined, and spreadsheets treat an empty cell as zero — so any division whose denominator is blank or 0 returns #DIV/0!. The clean fix is to check the denominator before dividing: IF(B2=0,"",A2/B2) shows an empty cell when there's nothing valid to divide by, and the real result otherwise. This is better than blanket IFERROR, which would also hide genuinely broken numerators. The same error appears in AVERAGEIF when no rows match the condition — guard those with COUNTIF first or IFERROR deliberately.
When to use it
Guard every division whose denominator comes from data entry — units sold, headcounts, response counts — since those columns inevitably have blank or zero rows.
Common mistakes
Got a file full of these?
Open it in your browser — every error cell gets highlighted with its fix. Nothing is uploaded.
Did this formula help?
Engine-verified against the sample data aboveLast reviewed 2026-07-08