How to Fix Excel AVERAGE #DIV/0! Error for Blank Ranges
Question details
The user needs a way to prevent the #DIV/0! error when using the AVERAGE function on a cell range that contains no numeric values.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating the average of a range of cells that might be completely empty or contain only non-numeric text data.
- Observed behavior
- The AVERAGE function ignores empty and text cells, meaning an empty range has a numeric count of zero. Dividing the sum by zero causes Excel to return a #DIV/0! error instead of 0.
Identify the cell range causing the #DIV/0! error and decide whether you want blank cells to be ignored entirely (returning 0 for the whole empty range) or explicitly treated as individual zero values in your average calculation.
Use IFERROR to Return Zero for Empty Ranges
This is the most straightforward method to handle the error by substituting the #DIV/0! result with a 0, preventing the error from affecting dependent formulas.
The IFERROR function catches any error produced by the primary formula and replaces it with a specified value. Since calculating the average of zero numeric values mathematically results in a division by zero, wrapping the AVERAGE function in IFERROR is the cleanest solution.
Click on the cell where you want the average result to be displayed.
Type =IFERROR(AVERAGE(A1:A10), 0) into the formula bar, replacing A1:A10 with your actual cell range.
Press the Enter key. If the range is empty or contains only text, the cell will now display 0 instead of #DIV/0!.

Use an Array Formula to Treat Blanks as Zeros
Use this method if you need empty cells within the range to actually count as zero values, which will lower the overall calculated average.
Fix Formula Errors Easily with WPS Spreadsheet
WPS Spreadsheet offers full compatibility with Excel functions like AVERAGE, IFERROR, and array formulas. You can use the exact same formulas to manage blank cells and avoid #DIV/0! errors in your financial or data analysis tasks.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook containing the data range.
- 2. Select the calculation cell: Click the cell where you need to calculate the average.
- 3. Apply the error-handling formula: Type =IFERROR(AVERAGE(Your_Range), 0) and press Enter to instantly fix the #DIV/0! error.

Frequently Asked Questions
Why does AVERAGE return #DIV/0! instead of 0?
The AVERAGE function calculates the sum of the numbers divided by the count of numeric values. Since blank cells and text strings are ignored, an empty range has a numeric count of zero. Dividing the sum by zero triggers the #DIV/0! error, as division by zero is mathematically undefined.
Does the AVERAGEA function fix the blank cell error?
No, it does not fully fix it. While AVERAGEA evaluates text strings and logical values (like TRUE/FALSE) as numbers, it still ignores completely blank cells. If a range is entirely blank, AVERAGEA will also return a #DIV/0! error.
How can I calculate the average ignoring 0 values and blank cells?
To ignore both blank cells and cells that contain the number 0, you can use the AVERAGEIF function. The formula would be =AVERAGEIF(A1:A10, "<>0"). However, if no cells meet the criteria, it will still return #DIV/0!, so wrapping it in IFERROR is still recommended.




