DCOUNT: Criteria-Based Numeric-Cell Count in WPS Spreadsheet
Use DCOUNT with a labelled database, field selector and numeric criteria. Follow complete input tables and independently checked numeric-cell count examples.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
DCOUNT returns the numeric-cell count of a selected database field for records meeting a criteria range. The database is an ordinary labelled table: the first row contains field names, each later row is a record, and each column is a field. A database server or pivot object is not required by this documented contract.
Syntax and field selection
=DCOUNT(database, field, criteria)
All three arguments are supplied in this guide. Database includes the header row. Field can be a quoted header name, a one-based column position within the database, or the header-cell reference illustrated in the lesson. Criteria is a separate range containing at least a field label and a condition beneath it.
A numeric field index is relative to the database, not the entire worksheet. Thus 2 selects Hours in A1:C6. Moving the table would not turn its second field into a different field number merely because the worksheet column changes.
Enter a complete original database
| Row | A: Age | B: Hours | C: Amount |
|---|---|---|---|
| 1 | Age | Hours | Amount |
| 2 | 25 | 4 | 100 |
| 3 | 35 | 8 | 200 |
| 4 | 40 | 12 | 300 |
| 5 | 30 | 0 | 0 |
| 6 | 50 | 16 | 400 |
Put the text Age in E1 and the criterion text >30 in E2. Keep E1:E2 outside the database. The selected records are ages 35, 40 and 50. Their Hours values are 8, 12 and 16; their Amount values are 200, 300 and 400.
Enter =DCOUNT(A1:C6,"Hours",E1:E2). The expected answer is 3, because the selected Hours cells contain three numbers. Using field 2 gives the same column. Counting Amount also gives 3 in this fully numeric dataset, even though its numeric values are much larger. DCOUNT counts observations rather than adding their magnitudes.
Change one criterion at a time
With E2 changed to >45, only age 50 qualifies. With E2 changed to >20, all five records qualify, including the row containing zero. Restore >30 before evaluating a formula whose description assumes that threshold.
- E2 =
>30;=DCOUNT(A1:C6,"Hours",E1:E2)→ 3. - E2 =
>30;=DCOUNT(A1:C6,2,E1:E2)→ 3. - E2 =
>30;=DCOUNT(A1:C6,"Amount",E1:E2)→ 3. - E2 =
>45;=DCOUNT(A1:C6,"Hours",E1:E2)→ 1. - E2 =
>20;=DCOUNT(A1:C6,"Hours",E1:E2)→ 5. - E2 =
>30;=DCOUNT(A1:C6,C1,E1:E2)→ 3.
Practical interpretation
The broader >20 selection counts 5 numeric Hours cells, including zero. This is useful for checking how many numeric observations support a later summary. It is not automatically a count of every matching record when the chosen field can contain text or blanks. Choose a reliably numeric field if the goal is to count numeric observations, and distinguish DCOUNTA’s nonempty-value purpose rather than assuming the names are aliases.
Troubleshooting and bounded criteria scope
Copy the criteria header exactly from the database so it identifies the intended field. Include the header row in the database and in the criteria range; a bare condition cell is not the documented labelled criteria structure. Keep the output separate from the input table to make the calculation easy to inspect.
These examples use one numeric threshold and numeric result fields. The cited lesson does not fully establish all wildcard, case-sensitivity, formula-criterion, empty-condition, error-cell or multi-field combination behaviors. No blanket Excel criteria rule is imported. No-match error/result details are also outside these independently checked examples; do not assume a particular localized error token from this guide.
For a surprising answer, first list the qualifying rows manually, then verify the chosen field. A correct selection with the wrong field can still produce a plausible number. Headers, numeric-looking text and actual numeric values should be reviewed separately before applying a database aggregate to messy imported data.
Availability and evidence
The official WPS lesson is dated 2019-05-21 and explicitly labels its applicability WPS Office for Windows Personal. It does not identify a numeric release. This establishes documentation by that date, not the function’s original introduction or its last working version. Current build limits and equivalence across WPS clients remain unverified. The available evidence does not establish retirement or formal deprecation.
Checked October 18, 2026. The examples in this guide are original, independently calculated controls based on the lesson. They have not been run in WPS or another spreadsheet application. No screenshot or execution result is claimed.