DSUM Function
Adds up a column for the records that match your criteria.
Category
Database
Available in
All versions, Microsoft 365
Returns
A number
Overview
DSUM totals one column of a list, but only for the rows that meet conditions you type into a small criteria range on the sheet.
Because the conditions live in cells, changing a report is as easy as typing a different region or threshold — no editing of the formula.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| database | Yes | The whole list, including the header row — e.g. A1:E7. Each row is a record, each column a field. |
| field | Yes | Which column to calculate: its header in quotes ("Sales"), a cell holding the header, or its position (5 = the fifth column). |
| criteria | Yes | A small range with at least one header copied exactly from the list and the conditions underneath, e.g. G1:G2. |
Examples
Example 1 — Total sales for one region
The criteria range G1:G2 says Region = North.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Region | Rep | Product | Units | Sales | Region | |
| 2 | North | Amara | Paper | 40 | 520 | North | |
| 3 | South | Ben | Toner | 12 | 576 | ||
| 4 | North | Chloe | Toner | 8 | 384 | North sales | |
| 5 | East | Dev | Paper | 25 | 325 | 1024 | |
| 6 | North | Amara | Pens | 100 | 120 | ||
| 7 | South | Ella | Paper | 30 | 390 |
Example 2 — Two conditions together (AND)
North orders with more than 20 units: both conditions sit on the same row.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Region | Rep | Product | Units | Sales | Region | Units | |
| 2 | North | Amara | Paper | 40 | 520 | North | >20 | |
| 3 | South | Ben | Toner | 12 | 576 | |||
| 4 | North | Chloe | Toner | 8 | 384 | Sales | ||
| 5 | East | Dev | Paper | 25 | 325 | 640 | ||
| 6 | North | Amara | Pens | 100 | 120 | |||
| 7 | South | Ella | Paper | 30 | 390 |
Example 3 — Either condition (OR)
North or East: put each alternative on its own row.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Region | Rep | Product | Units | Sales | Region | |
| 2 | North | Amara | Paper | 40 | 520 | North | |
| 3 | South | Ben | Toner | 12 | 576 | East | |
| 4 | North | Chloe | Toner | 8 | 384 | ||
| 5 | East | Dev | Paper | 25 | 325 | Sales | |
| 6 | North | Amara | Pens | 100 | 120 | 1349 | |
| 7 | South | Ella | Paper | 30 | 390 |
Example 4 — A range between two values
Repeat the header to apply two conditions to the same column: Sales from 300 to 500.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Region | Rep | Product | Units | Sales | Sales | Sales | |
| 2 | North | Amara | Paper | 40 | 520 | >=300 | <=500 | |
| 3 | South | Ben | Toner | 12 | 576 | |||
| 4 | North | Chloe | Toner | 8 | 384 | Sales | ||
| 5 | East | Dev | Paper | 25 | 325 | 1099 | ||
| 6 | North | Amara | Pens | 100 | 120 | |||
| 7 | South | Ella | Paper | 30 | 390 |
Common mistakes
- #VALUE! or a total of 0. The field name or a criteria header doesn't match the list's header exactly — a stray space is enough. Copy the header rather than retyping it.
- A blank row inside the criteria range. An empty criteria row means “no condition”, so every record is included. Make the criteria range only as tall as the conditions.
Notes
- Criteria rules: conditions on the same row must all be true (AND); conditions on separate rows are alternatives (OR). Text such as Nor matches anything that begins with it — type ="=North" for an exact match. Use >500, <>East, or wildcards like *Paper*.
- In Microsoft 365, SUMIFS, COUNTIFS, AVERAGEIFS and FILTER do the same jobs with the conditions written in the formula. The database functions shine when you want the conditions visible on the sheet, where anyone can change them.
- Related functions: DSUM, DAVERAGE, DCOUNT, DCOUNTA, DGET, DMAX, DMIN, DPRODUCT, DSTDEV, DSTDEVP, DVAR, DVARP.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.