DCOUNTA
Counts non-blank values in a database field for records matching criteria.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=DCOUNTA(database, field, criteria)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
database | any | Required | — |
field | any | Required | — |
criteria | any | Required | — |
Remarks
- An equality criterion for a date or number (
"10/26/1999","36459",36459) also matches text cells holding that date;<>and ordering criteria do not read date text. DCOUNTAcounts both text and numeric non-empty values.- Criteria rows are OR-ed; criteria columns in the same row are AND-ed.
- Blank cells are excluded from the count.
Examples
Count the populated values in the Score column for the two East records.
Formula =DCOUNTA(A1:B4,"Score",D1:D2)
| A | B | D | |
|---|---|---|---|
| 1 | "Team" | "Score" | "Team" |
| 2 | "East" | 8 | "East" |
| 3 | "West" | 3 | |
| 4 | "East" | 10 |
Expected result 2
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Use field number 2 to get the same populated count for East.
Formula =DCOUNTA(A1:B4,2,D1:D2)
| A | B | D | |
|---|---|---|---|
| 1 | "Team" | "Score" | "Team" |
| 2 | "East" | 8 | "East" |
| 3 | "West" | 3 | |
| 4 | "East" | 10 |
Expected result 2
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
With the West filter, only the score of 3 contributes to the populated count.
Formula =IFERROR(DCOUNTA(A1:B4,"Score",E1:E2),"Insufficient data")
| A | B | E | |
|---|---|---|---|
| 1 | "Team" | "Score" | "Team" |
| 2 | "East" | 8 | "West" |
| 3 | "West" | 3 | |
| 4 | "East" | 10 |
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The missing field header prevents calculating the populated count for East.
Formula =DCOUNTA(A1:B4,"Missing",D1:D2)
| A | B | D | |
|---|---|---|---|
| 1 | "Team" | "Score" | "Team" |
| 2 | "East" | 8 | "East" |
| 3 | "West" | 3 | |
| 4 | "East" | 10 |
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Count non-blank names where score > 80
Formula =DCOUNTA(A1:B4,"Name",D1:D2)
| A | B | D | |
|---|---|---|---|
| 1 | "Name" | "Score" | "Score" |
| 2 | "Ana" | 92 | ">80" |
| 3 | "Bo" | 75 | |
| 4 | "Cy" | 88 |
Expected result 2
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Count X, Y and the stored empty string as three entries
Formula =DCOUNTA(A1:A4,"Item",C1:C1)
| A | C | |
|---|---|---|
| 1 | "Item" | "Item" |
| 2 | "X" | |
| 3 | "Y" | |
| 4 | "" |
Expected result 3
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
What is treated as blank in DCOUNTA?
Empty cells and empty strings are treated as blank; other value types are counted when their row matches criteria.