Prevent a #DIV/0! Error When Dividing by a Blank Cell in Excel
Question details
Prevent a percentage formula from displaying #DIV/0! when its denominator is blank or zero.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A formula divides the sum of C5, D5, and F5 by B5, but B5 may have no source data.
- Observed behavior
- Excel displays #DIV/0! when B5 is blank or zero.
Check that B5 is the denominator and that C5, D5, and F5 are the cells you want to add. Select the cell containing the percentage formula so you can replace it.
Check the denominator with an IF formula
Use this option to leave the result visually blank when B5 is zero or empty while allowing other formula errors to remain visible.
In Excel, click the cell that currently contains the division formula.
In the formula bar, enter =IF(B5=0,"",SUM(C5,D5,F5)/B5) and press Enter.
Leave B5 blank or enter 0 to check that the result appears blank. Enter a nonzero value in B5 to calculate the ratio.

Hide formula errors with IFERROR
Use IFERROR when you want the formula to display a blank result for any calculation error.
Prevent division errors in WPS Spreadsheets
Use the same IF formula in WPS Spreadsheets to show a blank result when the denominator is empty or zero.
- 1. Open the spreadsheet: Open WPS Spreadsheets and use Open to select your workbook.
- 2. Select the result cell: Click the cell where the percentage formula should appear.
- 3. Enter the formula: In the formula bar, enter =IF(B5=0,"",SUM(C5,D5,F5)/B5) and press Enter.
- 4. Test and format the result: Check the result with a blank, zero, and nonzero value in B5. If needed, select the result cell and choose Percentage from the Home tab.

Frequently Asked Questions
Why does a blank denominator cause #DIV/0! in Excel?
Excel treats a blank cell used as a divisor as zero. Use =IF(B5=0,"",SUM(C5,D5,F5)/B5) to check B5 before dividing.
How can I show zero instead of a blank result?
Replace the empty string in the IF formula with 0: =IF(B5=0,0,SUM(C5,D5,F5)/B5).
Will IFERROR hide errors other than #DIV/0!?
Yes. IFERROR returns its specified fallback for any error in the wrapped calculation. Use the IF check on B5 if you only want to handle a blank or zero denominator.
How do I display the calculated ratio as a percentage?
Select the result cell and choose Percentage on the Home tab. For example, a calculated ratio of 0.25 will display as 25%.




