Database function

DAVERAGE function

Averages the values in one column of a list, using only the records that match conditions written in a separate criteria range.

Available in All versions of Excel, including Microsoft 365 and Excel for the web

In every Excel versionWorks in Google Sheets

Syntax

DAVERAGE(database, field, criteria)
ArgumentWhat it means
databaseRequiredThe whole list including its header row, e.g. A1:D7.
fieldRequiredThe column to average: its header in quotes ("Salary") or its position in the list (4).
criteriaRequiredA range with at least one header that matches a header in the list, and conditions underneath it.

Returns: The average of the matching values in field.

How DAVERAGE works

DAVERAGE belongs to Excel's family of database functions (the "D" functions). They all work the same way: you point them at a list with headers, name the column you want to calculate on, and give them a small criteria range — a separate block of cells where you write the conditions under copies of the column headings. DAVERAGE then averages only the rows that pass the conditions.

The advantage over AVERAGEIFS is flexibility. Conditions on the same row of the criteria range must all be met (AND); conditions on different rows are alternatives (OR). Because the criteria live in cells, a manager can change the department or the threshold without touching the formula, which makes D-functions a good fit for small dashboards and what-if reports.

Text conditions in the criteria range match values that begin with the text, so Sales also matches Sales Support. Write ="=Sales" in the criteria cell when you need an exact match.

Examples

1Average salary in the Sales department

F2fx=DAVERAGE(A1:D7, "Salary", A9:A10)
ABCDEF
1DeptNameYearsSalary
2SalesAna34200042333.33
3ITBen758000
4SalesCarla546500
5ITDev249000
6HREli951000
7SalesFay138500
8
9Dept
10Sales

Result: 42333.33

The criteria range has the column heading in the first row and the condition underneath. The Sales staff earn 42,000, 46,500 and 38,500; their average is 127,000 / 3 = 42,333.33 (shown with two decimals).

2Average salary for staff with at least 5 years

F2fx=DAVERAGE(A1:D7, 4, A9:A10)
ABCDEF
1DeptNameYearsSalary
2SalesAna34200051833.33
3ITBen758000
4SalesCarla546500
5ITDev249000
6HREli951000
7SalesFay138500
8
9Years
10>=5

Result: 51833.33

Here the field is given by position (4 = Salary). Ben, Carla and Eli have at least 5 years: (58,000 + 46,500 + 51,000) / 3 = 51,833.33.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#DIV/0!No record matches the criteria, so there is nothing to average.Check the criteria spelling, or wrap the formula in IFERROR.
#VALUE!The field name does not match any header in the list.Copy the header text exactly, or use the column number.

Tips

  • Keep the criteria range away from the list (above it or on another sheet) so that adding records never overwrites it.
  • An empty row inside the criteria range means "no condition" and matches every record — make the criteria range exactly as tall as your conditions.

Google Sheets

DAVERAGE also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

DAVERAGE in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechDPRŮMĚR
DanishDMIDDEL
DutchDBGEMIDDELDE
FinnishTKESKIARVO
FrenchBDMOYENNE
GermanDBMITTELWERT
HungarianAB.ÁTLAG
ItalianDB.MEDIA
Norwegian (Bokmål)DGJENNOMSNITT
PolishBD.ŚREDNIA
Portuguese (Brazil)BDMÉDIA
Portuguese (Portugal)BDMÉDIA
RussianДСРЗНАЧ
SpanishBDPROMEDIO
SwedishDMEDEL
TurkishVSEÇORT