D count
DCOUNT Function¶
The DCOUNT function counts the numeric cells in a column of a database for rows that match a criteria range. It is the database-style counterpart to COUNTIF / COUNTIFS restricted to numeric values.
Syntax:¶
DCOUNT(database, field, criteria)
- database: A range whose first row contains column headers.
- field: The column whose numeric cells are counted. Either the 1-based column number or the header label. May be omitted (or empty), in which case
DCOUNTreturns the number of matched rows. - criteria: A range whose first row matches one or more
databaseheaders, with filter values in subsequent rows.
Examples:¶
=DCOUNT(A1:E11, "Salary", G1:G2)whereG1:G2isDept/Eng— counts rows in Dept="Eng" with a numeric Salary cell.=DCOUNT(A1:E11, "Name", G1:G2)— returns 0, because Name is text (DCOUNT counts numeric cells only).=DCOUNT(A1:E11, , G1:G2)— field omitted, returns the count of matched rows.
Usage Notes:¶
- Text and empty cells in the field column are not counted.
- Use
DCOUNTAwhen you want to count non-empty cells regardless of type. - Returns 0 when no rows match the criteria.
- Comparison operators and wildcards supported in criteria values.