How to Return Zero for #DIV/0! Errors Using IFERROR in Excel
Question details
The user wants to replace the default #DIV/0! formula error with a clean, numeric zero (0) during spreadsheet calculations.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Performing division or mathematical calculations where the divisor might occasionally be zero or refer to an empty cell.
- Observed behavior
- Instead of showing the disruptive #DIV/0! error, the cell needs to cleanly output a numeric 0 so it does not break downstream formulas.
Identify the cells or columns where your division formula is returning the #DIV/0! error, and double-check that returning a zero is mathematically appropriate for your dataset.
Wrap Your Formula in the IFERROR Function
The most efficient way to handle calculation errors is by nesting your original formula inside the IFERROR function to specify an alternative output.
The IFERROR function evaluates a calculation and checks if it results in an error (such as #DIV/0!, #N/A, or #VALUE!). If an error is detected, it outputs a customized value of your choosing. If the calculation is valid, it simply returns the normal mathematical result.
Double-click the cell containing the formula that is currently resulting in the #DIV/0! error, or click it once and click inside the formula bar.
Place your cursor immediately after the equals sign (=) and type IFERROR( to initiate the function.
Leave your original calculation intact. Move your cursor to the very end of the formula, type a comma followed by a zero, and close the parentheses. E.g., , 0).
Press Enter. Your formula should now look something like this: =IFERROR(($B$2-B2)*-10/$B$5, 0). The cell will display 0 if the divisor is empty or zero.

Easily Handle Formula Errors with WPS Spreadsheet
WPS Spreadsheet provides full, native support for advanced functions like IFERROR, allowing you to create clean, error-free spreadsheets with ease. It is a powerful and free tool for all your data analysis needs.
- 1. Open your spreadsheet: Launch WPS Office and open your workbook containing the data.
- 2. Locate the formula: Select the cell with the division calculation returning the #DIV/0! error.
- 3. Apply IFERROR: Edit the formula in the formula bar to read =IFERROR(your_formula, 0) and press Enter to apply.

Frequently Asked Questions
Why does my spreadsheet show a #DIV/0! error?
This error occurs when a formula attempts to divide a number by zero or by a cell that is completely empty. Since division by zero is mathematically impossible, the spreadsheet returns a #DIV/0! error.
Can I leave the cell blank instead of showing a zero?
Yes. If you prefer the cell to look completely empty when an error occurs, you can use empty double quotation marks in the IFERROR function instead of a zero. For example: =IFERROR(A2/B2, "").
Does IFERROR hide all types of spreadsheet errors?
Yes, the IFERROR function acts as a blanket catch-all. It will replace #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, and #NULL! errors with your specified alternative value.
What is the difference between IF(ISERROR()) and IFERROR?
IFERROR is a newer, more efficient function that combines IF and ISERROR into a single step. Using =IF(ISERROR(A2/B2), 0, A2/B2) achieves the same result but requires typing the calculation twice and makes the software evaluate the formula twice, slowing down large workbooks.




