How to Fix the DAVERAGE #DIV/0! Error in Excel
Question details
The user is encountering a #DIV/0! error when using the DAVERAGE function and wants to know how to remove or handle it.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating an average from a database using the DAVERAGE function based on specific criteria.
- Observed behavior
- The formula returns a #DIV/0! error because no records in the dataset match the criteria, causing Excel to attempt a division by zero.
Double-check your criteria range and database dataset to ensure there are no hidden spaces, typos, or spelling mistakes causing a criteria mismatch.
Wrap the Formula with the IFERROR Function
The most reliable way to handle this error is to use the IFERROR function, which replaces the #DIV/0! error with a cleaner custom value, such as 0 or a blank cell.
When the DAVERAGE function finds no matching records, it tries to divide the total sum by zero. The IFERROR function catches this mathematical error and allows you to specify exactly what should be displayed instead.
Click on the cell currently displaying the #DIV/0! error generated by your DAVERAGE formula.
Click inside the Formula Bar at the top of the Excel worksheet to modify the existing text.
Wrap your existing formula inside the IFERROR function. For example, change it to: =IFERROR(DAVERAGE(A8:I22,"Supervisor Review",O12:O13), 0).
Press Enter on your keyboard to calculate the new formula. The cell will now display 0 instead of the error.

Verify and Update Criteria Matching
Resolve the root cause by ensuring that at least one row in your database perfectly matches the specified criteria.
Easily Manage Database Functions in WPS Spreadsheet
WPS Spreadsheet provides robust support for all standard database and error-handling functions, including DAVERAGE and IFERROR. You can quickly troubleshoot formula errors using its intuitive interface.
- 1. Open your file in WPS: Launch WPS Office and open your workbook using WPS Spreadsheet.
- 2. Locate the error cell: Find the cell displaying the #DIV/0! error and click on it.
- 3. Apply IFERROR: Use the formula bar to wrap your DAVERAGE function with =IFERROR(..., 0) and press Enter.

Frequently Asked Questions
Why does the DAVERAGE function specifically return #DIV/0!?
The DAVERAGE function calculates the average of values in a database that meet specific criteria. If no records match your criteria, the count of matching items is zero. Excel attempts to divide the total sum by zero to find the average, which triggers the #DIV/0! mathematical error.
Can I show a blank cell instead of the #DIV/0! error?
Yes. By wrapping your DAVERAGE formula in the IFERROR function, you can tell Excel to output a blank cell when an error occurs. Use the syntax =IFERROR(DAVERAGE(...), "").
Does the IFERROR function hide other legitimate formula errors?
Yes, the IFERROR function will catch and replace all standard Excel errors, including #N/A, #VALUE!, #REF!, and #NAME?. It is highly recommended to ensure your DAVERAGE formula is structurally correct before wrapping it in IFERROR.




