logo
search
Formula Errors

How to Return Zero for #DIV/0! Errors Using IFERROR in Excel

Khadija KhanKhadija Khan Oct 23, 2026 868 views

Question details

The user wants to replace the default #DIV/0! formula error with a clean, numeric zero (0) during spreadsheet calculations.

How to Return Zero for Excel DIV/0 Errors with IFERROR
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the error cell

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.

2
Add the IFERROR function

Place your cursor immediately after the equals sign (=) and type IFERROR( to initiate the function.

3
Specify the zero output

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).

4
Apply the new formula

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.

Wrap Your Formula in the IFERROR Function
Use Numeric Zero, Not Text: Ensure you type the number 0 without quotation marks. If you type "0", Excel treats the output as a text string, which can cause #VALUE! errors in other formulas that reference this cell.
Manage Errors Seamlessly in WPS

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. 1. Open your spreadsheet: Launch WPS Office and open your workbook containing the data.
  2. 2. Locate the formula: Select the cell with the division calculation returning the #DIV/0! error.
  3. 3. Apply IFERROR: Edit the formula in the formula bar to read =IFERROR(your_formula, 0) and press Enter to apply.
100% compatible with Microsoft Excel formulas, functions, and file formats.Intuitive formula builder with built-in syntax highlighting for easy error-checking.Lightweight software that processes large datasets and complex arrays quickly.
microsoft office alternative - wps office

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.