Quick Answer

DCOUNTA Function

Counts non-blank values in a database column for rows that meet the criteria.

✓ Excel✓ Google SheetsExcel All versions

Syntax

DCOUNTA
(database, field, criteria)

Parameters

ParameterDescriptionRequired
databaseThe range containing the database, including the header row as the first row.Required
fieldThe column to count, given as the column label in quotes (e.g. "Tree") or its 1-based column index.Required
criteriaThe 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)
Result2

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 column

DCOUNT returns 0 on a text field, but DCOUNTA counts the non-blank text entries.

=DCOUNTA(A1:E7, "Tree", A9:B10)
Result: 2
Both matching rows have a Tree label, so DCOUNTA returns 2 while DCOUNT would return 0.

Example 2: Count all apple-tree records

Single condition Tree=Apple

Use criteria A9:A10 to count every non-blank field cell among apple rows.

=DCOUNTA(A1:E7, "Yield", A9:A10)
Result: 3
Three apple rows exist, each with a non-blank numeric Yield, so the count is 3.

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.

1
Set up the database
Enter your table with a header row, e.g. A1:E7 with Tree, Height, Age, Yield, Profit.
2
Set up criteria
Place criteria headers and values in a separate range, e.g. A9:B10.
3
Enter DCOUNTA
Type =DCOUNTA(A1:E7, "Tree", A9:B10) and press Enter.

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

Practice 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.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

How is DCOUNTA different from DCOUNT?
DCOUNT counts only numeric cells; DCOUNTA counts any non-blank cell, including text.
Does DCOUNTA count empty cells?
No. Only non-blank cells in the field of matching rows are counted.
When should I use DCOUNTA?
Use it when you need to tally matching records regardless of whether the field holds numbers or text.