Formula guide · Excel and Google Sheets · Updated May 13, 2026
How to Fix #DIV/0! in Excel and Google Sheets
Fix #DIV/0! errors when a formula divides by zero, blank cells, or missing values.
Quick Answer
#DIV/0! means the formula is dividing by zero or by an empty cell. Use IF or IFERROR after checking whether zero is expected.
Copyable Formula
=IF(B2=0,"",A2/B2)
Syntax
=IFERROR(numerator/denominator,"")
Excel and Google Sheets
Worked Example
| A | B | C |
|---|---|---|
| Revenue | Orders | Average |
| 1200 | 0 | |
| 900 | 3 | 300 |
Result: Returns a blank when Orders is zero, and returns the average when Orders has a valid number.
Steps
- Check which cell is the denominator.
- Decide whether zero means missing data or a true zero.
- Use IF to handle zero intentionally.
- Use IFERROR only when a broad fallback is acceptable.
Common Mistakes
- Hiding all errors with IFERROR before checking the denominator.
- Treating blank cells and true zeroes as the same business case.
- Returning zero when a blank or warning message would be clearer.
Excel vs Google Sheets Notes
The core idea works in both Excel and Google Sheets, but separators, function availability, and array behavior can vary by account, locale, and version.
Editorial check: This guide was last updated May 13, 2026. Formula behavior can vary by Excel version, Google Sheets rollout, and spreadsheet locale.