DCOUNT Function
Counts numeric 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. "Yield") 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 numeric Yield values for apple trees taller than 10
=DCOUNT(A1:E7, "Yield", A9:B10)The criteria A9:B10 (Tree=Apple, Height>10) matches two rows, and both have numeric Yield values, so the count is 2.
Advanced Examples
Example 1: Count a column with blank or text cells
A field that mixes numbers and textIf the chosen field contained a text label in one matching row, DCOUNT would exclude it because only numbers are counted.
=DCOUNT(A1:E7, "Tree", A9:B10)Example 2: Count with a single condition
Count all apple-tree records with numeric YieldUse criteria Tree=Apple across A9:A10.
=DCOUNT(A1:E7, "Yield", A9:A10)How DCOUNT Works
DCOUNT filters the database to rows matching the criteria, then counts how many of those rows contain a numeric value in the specified field column. Empty cells and text in the field are not counted.
Important Notes & Limitations
Counts only numeric cells; text and blank cells in the field are ignored.
Criteria header labels must exactly match database headers.
If you need to count non-numeric entries, use DCOUNTA.
Common Errors & Fixes
0 resultThe chosen field holds text, or no rows matched the criteria.Fix: Use a numeric field, or switch to DCOUNTA for non-numeric entries.
#VALUE!The field was an unquoted column name.Fix: Wrap the field name in quotes, e.g. "Yield", or use the column index.
Download Practice File
DCOUNT
dcountPractice DCOUNT with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the DCOUNT function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps