DSUM in Excel: Criteria-Selected Totals and Overlapping Groups
Calculate Excel database totals with explicit criteria, distinguish AND from OR and reconcile overlapping group totals without double-counting.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: DSUM adds the numbers in a selected database field. =DSUM(A1:D7,"Sales",F1:G2) has independently expected result 600, the total Sales for North/A records.
Syntax and database layout
=DSUM(database, field, criteria)
The database range includes the header row. Field identifies the column to calculate: use a quoted heading such as “Units”, or its one-based position within the database. Here Units is field 3, even if the database is later moved to another part of the sheet. Criteria is a separate range containing matching field headers and at least one conditions row. All three arguments are required.
Enter this numeric database in A1:D7:
| Team | Product | Units | Sales |
|---|---|---|---|
| North | A | 2 | 100 |
| North | B | 9 | 450 |
| South | A | 10 | 500 |
| North | A | 4 | 200 |
| South | B | 7 | 350 |
| North | A | 6 | 300 |
Put Team in F1 and Product in G1. In F2 enter ="=North"; in G2 enter ="=A". These formulas produce the exact-match criteria text =North and =A. The range F1:G2 selects the three North/A records, whose Units values are 2, 4 and 6 and Sales values are 100, 200 and 300.
Conditions in the same criteria row act together with AND. Alternative criteria rows act with OR. Keep the criteria and output cells outside the database, and leave room for the data to grow.
Example 1: choose the amount being totaled
=DSUM(A1:D7,"Sales",F1:G2)
=DSUM(A1:D7,3,F1:G2)
Expected results are 600 Sales and 12 Units. The selected rows stay the same, but field determines which values are added. A field-number change can therefore produce a plausible-looking yet entirely different business quantity.
For these records, total Sales divided by total Units is 50. That ratio is a weighted price-like measure under the fixture’s interpretation, not something DSUM calculates automatically.
Example 2: a one-condition total
Put Team in J1 and ="=North" in J2. =DSUM(A1:D7,"Sales",J1:J2) gives expected 1050, from 100+450+200+300. North/B adds 450 beyond the original North/A total.
Use the numeric field count and matching criteria alongside the total if it is part of a recurring report. A total’s change can arise from new data, a changed range or changed criteria.
Advanced application: OR selection without double-counting
Put Team in J4 and Product in K4. Put ="=North" in J5, leaving K5 blank. Put ="=A" in K6, leaving J6 blank. The formula below selects North records or Product A records:
=DSUM(A1:D7,"Sales",J4:K6)
Expected total: 1550. North Sales total 1050; Product A Sales total 1100. Adding those subgroup totals directly would give 2150 and double-count the North/A overlap of 600. Inclusion-exclusion gives 1050+1100−600=1550.
A matching record belongs once to the selected union even if it satisfies both alternatives. This differs from adding independently computed, overlapping summaries.
Advanced application: two conditions on the same field
In a fresh criteria area J9:K10, enter Sales in both header cells. Put >=200 in J10 and <=350 in K10. DSUM on Sales with that criteria range has expected 850, from the values 200, 350 and 300.
The duplicate field headers allow a lower and upper bound in one criteria row, so both must hold. Putting the two comparisons on separate rows would form alternatives and select a much broader set.
Advanced check: reconcile disjoint groups
North Sales are 1050 and South Sales are 850; together they equal the full numeric total 1900. Those team groups are disjoint and cover all six records, so their sums can be added without overlap correction.
If an additional team appears later, a two-team reconciliation would no longer cover the database. Verify both group exclusivity and coverage rather than assuming that group totals always reconstruct the overall result.
Errors and no-data interpretation
The dedicated reference does not provide a comprehensive invalid-field or mixed-error table. Exact native boundary codes are not asserted. A reported zero may represent a genuine balanced total, zero-valued observations, or a selection with no contributing numbers; counts and source inspection help distinguish them.
The numeric fixture avoids text and blank target fields. Do not assume that every imported numeric-looking string has become a number. Clean and validate the data before using a total as a reconciliation control.
Criteria checks and troubleshooting
Use the complete header-and-condition range, not just the condition cells. Check the field heading for spelling and spacing, and verify that a numeric field index still points to the intended column after a layout change. A worksheet’s visible rows are not a substitute for the explicit database range and criteria used in the formula.
Do not include an accidental empty conditions row in the criteria range: an unrestricted alternative can broaden selection. Microsoft’s DAVERAGE reference documents the shared AND/OR, exact-text and case-insensitive matching rules. These examples avoid wildcard, case-sensitive-formula and numeric-text complications.
The database functions do not validate whether the selected records are the right records for the question. Keep a matching-record or numeric-field count beside an important result. Native blank/formula-empty handling, coercion, extreme precision and error propagation not explicitly documented in this guide remain unverified.
Availability and version history
- Current documentation: the dedicated Microsoft reference lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
- Introduced: the first introduction version/build is not established by the dedicated reference used here.
- Last functioning version: unknown; a current help listing is not a last-working-build test.
- Evidence checked: October 15, 2026. Official documentation was freshly retrieved; examples were independently calculated. No native Excel, Mac or web-client execution was performed.
References and verification
- Microsoft DSUM reference.
- Microsoft function catalog and introduction-marker explanation.
- Editorial testing standards.
Examples use English function names and comma separators. Expected numbers are rounded independent mathematical calculations; documented error expectations are labeled as such. They are not captured Excel output. All illustrative data and policies are fictional.