Quick Formula: Replace #DIV/0! or #N/A With 0
Wrap any formula inside IFERROR(formula, fallback) so errors display a clean value instead of breaking reports:
=IFERROR(A2/B2, 0)
To leave the cell visually blank instead of showing 0 when an error happens, use "" as the second argument:
=IFERROR(A2/B2, "")
Worked Example: Division When Denominator Is Zero or Blank
| Cell A2 (Spend) | Cell B2 (Conversions) | Raw =A2/B2 |
=IFERROR(A2/B2, 0) |
|---|---|---|---|
| $500 | 25 | $20.00 | $20.00 |
| $500 | 0 | #DIV/0! | 0 |
| $200 | (blank) | #DIV/0! | 0 |
Practical Rules for Using IFERROR Safely
- Use numeric
0in columns you plan to sum or average: Returning text like"N/A"inside numeric columns can complicate downstream math, whereas0sums cleanly. - Test your inner formula before wrapping: Verify
A2/B2or your XLOOKUP / INDEX-MATCH formula works on normal rows first soIFERRORdoes not hide an underlying range mistake.
Try It Live: Customize your division or lookup formula in the Formula Finder, or review XLOOKUP's built-in fallback option.