Category: FUNCTION | Updated: 2026-11-22
How to Use the DCOUNTA Function in Google Sheets | Count Non-Blank Cells Matching Criteria
Syntax
=DCOUNTA(database, field, criteria)
- database: Specifies the entire cell range of the data, including headers in the first row.
- field: Specifies the header name of the column in which to count non-blank cells, or its column number from the left.
- criteria: Specifies the cell range containing the filter conditions (headers + condition values).
Practical Example with a Table
Here is an example of counting how many records in a customer list (A1:C6) with “Region is Tokyo” (specified in criteria range E1:E2) have a non-blank Notes column (text).
| Cell Range | Role | Contents |
|---|---|---|
A1:C6 |
Database | Row 1: Customer Name, Region, Notes / Rows 2–6: customer data |
E1:E2 |
Criteria Range | E1 = Region, E2 = Tokyo |
| Formula Cell | Count Result | =DCOUNTA(A1:C6, "Notes", E1:E2) → Outputs the count of Tokyo customers with non-blank notes |
Common Errors and Notes
- #VALUE! Error: Occurs if the specified
fieldname is not found in the database header row. - Exact Match vs. Prefix Match: Entering plain text in the criteria range performs a “starts-with” (prefix) match (e.g.,
Tokyoalso matchesTokyo Prefecture). To require an exact match, write="=Tokyo". - Criteria Range Selection Mistake: Including a blank row directly below the condition cell causes all rows to be matched.
Frequently Asked Questions
Q. How should I choose between DCOUNT and DCOUNTA?
A. DCOUNT counts "numbers only," while DCOUNTA counts "all non-blank data" including numbers, text, and dates. Use DCOUNTA when counting names or records with a filled-in status.
Q. Are cells returning an empty string ("") from a formula counted by DCOUNTA?
A. Yes. Cells that return an empty string ("") as the result of a formula are treated as "containing data" and are included in DCOUNTA's count.