DSUM: Criteria-Based Sum in WPS Spreadsheet
Use DSUM with a labelled database, field selector and numeric criteria. Follow complete input tables and independently checked sum examples.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
DSUM returns the sum 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
=DSUM(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 =DSUM(A1:C6,"Amount",E1:E2). The expected answer is 900, calculated as 200+300+400. Selecting "Hours" instead gives 36, calculated as 8+12+16. Field 2 selects Hours, while a reference to C1 selects Amount. The criterion field and the field being summed may differ.
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;=DSUM(A1:C6,"Hours",E1:E2)→ 36. - E2 =
>30;=DSUM(A1:C6,2,E1:E2)→ 36. - E2 =
>30;=DSUM(A1:C6,"Amount",E1:E2)→ 900. - E2 =
>45;=DSUM(A1:C6,"Hours",E1:E2)→ 16. - E2 =
>20;=DSUM(A1:C6,"Hours",E1:E2)→ 40. - E2 =
>30;=DSUM(A1:C6,C1,E1:E2)→ 900.
Practical interpretation
At a hypothetical allocation rate of 25 currency units per selected hour, the >30 group’s Hours total of 36 corresponds to 900 units by independent multiplication. That happens to match this example’s Amount total because its data were chosen that way. Real tables need not have a constant Amount-to-Hours ratio. Select the field matching the business quantity instead of relying on an accidental equality.
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-29 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.