D average
DAVERAGE Function¶
The DAVERAGE function returns the arithmetic mean of the values in a column of a database (a labeled range) for rows matching a criteria range. It is the database-style counterpart to AVERAGEIF / AVERAGEIFS.
Syntax:¶
DAVERAGE(database, field, criteria)
- database: A range whose first row contains column headers.
- field: The column to average. Either the 1-based column number or the header label (case-insensitive).
- criteria: A range whose first row matches one or more
databaseheaders, with filter values in subsequent rows. AND within a row, OR across rows.
Examples:¶
=DAVERAGE(A1:E11, "Salary", G1:G2)whereG1:G2isDept/Eng— average salary across all Eng rows.=DAVERAGE(A1:E11, "Years", G1:G2)— average years of experience for the same Eng group.=DAVERAGE(A1:E11, 3, G1:H2)withG1:H2=Dept/Salaryheaders andEng/>=100— average salary where Dept="Eng" AND Salary≥100.
Usage Notes:¶
- Returns 0 when no rows match the criteria (matches Excel).
- Non-numeric cells in the field column are ignored.
- Comparison operators (
>,>=,<,<=,<>,=) and wildcards (*,?) supported in criteria values.