DCOUNT function
Counts the cells containing numbers in one column of a list, for the records that meet the conditions in a criteria range.
Available in All versions of Excel, including Microsoft 365 and Excel for the web
In every Excel versionWorks in Google Sheets
Syntax
DCOUNT(database, [field], criteria)| Argument | What it means | |
|---|---|---|
database | Required | The list including its header row. |
field | Optional | The column whose numbers are counted, as a header in quotes or a column number. If left out (DCOUNT(A1:D7,, F1:F2)), every matching record is counted. |
criteria | Required | The criteria range: headers in the first row, conditions below. |
Returns: How many matching records have a number in field.
How DCOUNT works
DCOUNT counts matching records, but with a twist: when you name a field, it only counts records where that field holds a number. Text, empty cells and errors in that column are skipped. That makes it the database-function equivalent of COUNT combined with conditions, and handy for questions like "how many cable products have a real stock figure?".
Like the other D-functions, DCOUNT reads its conditions from a criteria range on the sheet: headings matching the list, with conditions under them. Conditions in the same row combine with AND, separate rows combine with OR. If you want to count matching records regardless of what the field contains, use DCOUNTA (counts non-empty cells) or leave out the field argument.
Examples
1Cable products with a numeric stock figure
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Item | Category | Stock | Supplier | ||
| 2 | HDMI cable | Cables | 120 | Volt | 2 | |
| 3 | USB-C cable | Cables | n/a | Volt | ||
| 4 | Mouse | Input | 45 | Clicko | ||
| 5 | Keyboard | Input | 0 | Clicko | ||
| 6 | Ethernet cable | Cables | 80 | NetPro | ||
| 7 | Webcam | Video | 15 | Lumo | ||
| 8 | ||||||
| 9 | Category | |||||
| 10 | Cables |
Result: 2
Three items are cables, but the USB-C cable's stock is the text n/a. DCOUNT only counts numbers, so the answer is 2 — a quick sign that one record needs a proper stock count.
2How many items are running low?
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Item | Category | Stock | Supplier | ||
| 2 | HDMI cable | Cables | 120 | Volt | 2 | |
| 3 | USB-C cable | Cables | n/a | Volt | ||
| 4 | Mouse | Input | 45 | Clicko | ||
| 5 | Keyboard | Input | 0 | Clicko | ||
| 6 | Ethernet cable | Cables | 80 | NetPro | ||
| 7 | Webcam | Video | 15 | Lumo | ||
| 8 | ||||||
| 9 | Stock | |||||
| 10 | <20 |
Result: 2
The keyboard (0) and the webcam (15) have fewer than 20 units, so the count is 2.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | The field name does not match a header in the list. | Check the spelling, or use the column number. |
Unexpectedly low count | Values in the field are numbers stored as text. | Convert them with VALUE or use DCOUNTA. |
Tips
- For simple counts with one or two conditions COUNTIFS needs no criteria range; DCOUNT shines when users should edit the conditions in cells, or when you need OR across fields.
- The criteria range can sit on a different sheet — a tidy way to build a filter panel.
Google Sheets
DCOUNT also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
DCOUNT in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | DPOČET |
| Danish | DTÆL |
| Dutch | DBAANTAL |
| Finnish | TLASKE |
| French | BDNB |
| German | DBANZAHL |
| Hungarian | AB.DARAB |
| Italian | DB.CONTA.NUMERI |
| Norwegian (Bokmål) | DANTALL |
| Polish | BD.ILE.REKORDÓW |
| Portuguese (Brazil) | BDCONTAR |
| Portuguese (Portugal) | BDCONTAR |
| Russian | БСЧЁТ |
| Spanish | BDCONTAR |
| Swedish | DANTAL |
| Turkish | VSEÇSAY |