D count a
DCOUNTA Function¶
The DCOUNTA function counts the non-empty cells in a column of a database for rows that match a criteria range. Unlike DCOUNT, it counts cells of any type (numbers, text, booleans), excluding only empty cells.
Syntax:¶
DCOUNTA(database, field, criteria)
- database: A range whose first row contains column headers.
- field: The column whose non-empty cells are counted. Either the 1-based column number or the header label. May be omitted, in which case
DCOUNTAreturns the number of matched rows. - criteria: A range whose first row matches one or more
databaseheaders, with filter values in subsequent rows.
Examples:¶
=DCOUNTA(A1:E11, "Name", G1:G2)whereG1:G2isDept/Eng— counts Eng rows with a non-empty Name.=DCOUNTA(A35:B41, "Qty", G1:G2)where Qty has one numeric, one text ("TBD"), and one empty cell among matched rows — returns 2.=DCOUNTA(A1:E11, , G1:G2)— field omitted, returns the number of matched rows.
Usage Notes:¶
- Empty cells (including cells with
"") are not counted. - Use
DCOUNTwhen you want to count only numeric cells. - Returns 0 when no rows match.