Quick Navigation
DCOUNTA Function
Summary
The Excel DCOUNTA function counts nonblank cells in a specified field of a database that match given criteria. It is part of Excel's database functions and can count all matching records when the field argument is omitted.
Syntax
DCOUNTA(database, field, criteria)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| database | Range |
Yes | Database range including column headers |
| field | String or Number |
No | Column to count (e.g., 'Profit' or 5) |
| criteria | Range |
Yes | Criteria range with at least one column header |
Using the DCOUNTA Function
DCOUNTA is used to count records in a database that meet specific conditions. The database should have column headers in the first row. Criteria can use comparison operators, wildcards, and multiple conditions. Place criteria range separately from database to avoid overlap.
Common DCOUNTA Examples
Basic DCOUNTA Example
=DCOUNTA(A4:E10, 'Profit', A1:F2)
Counts Profit entries where Tree = 'Apple' and Height is between 10 and 16.
Count All Matching Records
=DCOUNTA(A6:C10, , B1:B3)
Counts all rows in database A6:C10 that match criteria in B1:B3, regardless of column.
Multiple Criteria
=DCOUNTA(A6:C12, , A1:C2)
Counts rows with Category = 'Produce' AND Sales > 2000.
Frequently Asked Questions
Common Errors and Solutions
#VALUE!
Cause: Invalid field argument
Solution: Use a valid column label in quotes or a column number
Incorrect count results
Cause: Criteria range overlaps database
Solution: Place criteria range separately from database
No results returned
Cause: Incorrect criteria syntax for text matches
Solution: Use ='=text' for exact matches or proper wildcard syntax
Notes
- Criteria range should include column headers and at least one criteria cell below
- Use wildcards: * for multiple characters, ? for single character, ~ for literal * or ?
- Multiple criteria in same row = AND logic; different rows = OR logic
- Can use formulas in criteria but must reference first database row correctly
Compatibility
Available in: Excel 2016, Excel 2019, Excel 2021, Excel 2024, Microsoft 365, Excel for the web, Excel for Mac 2016+
Not available in: Excel 2013 and earlier versions, Excel Online (limited)
Content last reviewed: December 6, 2025
Update frequency: As needed
Excel versions tested: Excel 2016+, Excel for Microsoft 365, Excel for the web, Excel 2024, Excel 2021, Excel 2019