Forum Discussion
DAVERAGE devide by zero error
shazde2023 The DAVERAGE function is a database function in which the criteria argument must be a range of cells containing at least one column label and at least one cell below it with the condition to be met for that column. The column label(s) used in the criteria range MUST match a column header in the database range. For example:
DAVERAGE Function Setup
As you can see in the screenshot above, the criteria range B2:C3 includes the column label "Date" for both conditions, in order to average the "Amount" field (D5) where the "Date" is between February 1st and February 29th of the current year.
Some of the reasons DAVERAGE might return the #DIV/0! error include:
- the column labels used in the criteria range do NOT match any column header in the database range
- the conditions specified in the criteria range return NO matching records
- there are NO numeric values found in the column specified in the field argument
You can use the Advanced Filter feature to double-check which records are being returned by the conditions specified in your criteria range. On the ribbon, go to Data > Advanced, then select the same database and criteria ranges and click OK:
Advanced Filter
You can then select the entire value range returned by Advanced Filter to quickly view the Average of the results, shown in the status bar at the bottom of the Excel window:
Advanced Filter Results
If Advanced Filter returns no records, it means the conditions you've specified did not find a match, or you've made a mistake in the setup of the criteria range.
For more information, please see:
DAVERAGE: https://support.microsoft.com/en-gb/office/daverage-function-a6a2d5ac-4b4b-48cd-a1d8-7b37834e5aee
Advanced Filter: https://support.microsoft.com/en-us/office/filter-by-using-advanced-criteria-4c9222fe-8529-4cd7-a898-3f16abdff32b