DCOUNTA Function
Counts non-blank values in a database column for rows that meet the criteria.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| database | The range containing the database, including the header row as the first row. | Required |
| field | The column to count, given as the column label in quotes (e.g. "Tree") or its 1-based column index. | Required |
| criteria | The range with a header row matching database column names and one or more condition rows; only matching records are counted. | Required |
Basic Example
Count non-blank Tree values for apple trees taller than 10
=DCOUNTA(A1:E7, "Tree", A9:B10)The criteria A9:B10 matches two rows; the Tree field is non-blank (text) in both, so DCOUNTA counts 2.
Advanced Examples
Example 1: DCOUNTA vs DCOUNT on a text field
Counting the Tree columnDCOUNT returns 0 on a text field, but DCOUNTA counts the non-blank text entries.
=DCOUNTA(A1:E7, "Tree", A9:B10)Example 2: Count all apple-tree records
Single condition Tree=AppleUse criteria A9:A10 to count every non-blank field cell among apple rows.
=DCOUNTA(A1:E7, "Yield", A9:A10)How DCOUNTA Works
DCOUNTA filters the database to rows matching the criteria, then counts how many of those rows have a non-blank value in the specified field column. Both text and numbers are counted; only empty cells are excluded.
Important Notes & Limitations
Counts any non-blank cell, including text, so it is not limited to numbers like DCOUNT.
Truly empty cells in the field are not counted.
Criteria header labels must exactly match database headers.
Common Errors & Fixes
0 resultNo rows matched the criteria, or the field was entirely blank in matching rows.Fix: Verify the criteria headers and conditions match the database.
#VALUE!The field was an unquoted column name.Fix: Wrap the field name in quotes, e.g. "Tree", or use the column index.
Download Practice File
DCOUNTA
dcountaPractice DCOUNTA with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the DCOUNTA function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps