DSUM function
Adds up a column of a list for the records that meet conditions written in a criteria range, including AND and OR combinations.
Available in All versions of Excel, including Microsoft 365 and Excel for the web
In every Excel versionWorks in Google Sheets
Syntax
DSUM(database, field, criteria)| Argument | What it means | |
|---|---|---|
database | Required | The list to search, including its header row, e.g. A1:D7. Each row is a record, each column a field. |
field | Required | The column to add: its header in quotes ("Sales") or its position in the list (4 for the fourth column). |
criteria | Required | A cell range containing at least one column header from the list and one or more rows of conditions beneath it. |
Returns: The sum of field for all matching records (0 if none match).
How DSUM works
DSUM is a conditional sum that takes its conditions from cells on the worksheet rather than from inside the formula. You build a small criteria range: copy one or more column headings from your list and type the conditions under them — East under Region, >30 under Units. DSUM then adds the chosen column for every record that passes. Change a condition cell and the total updates, without anyone editing the formula.
The layout of the criteria range carries the logic. Conditions on the same row must all be true (AND): Region = East and Units > 30. Conditions on different rows are alternatives (OR): Region = East, or Region = West. To set a range on one field, repeat the heading in two columns: Sales >=3000 next to Sales <=6000. This makes OR conditions across different fields — awkward with SUMIFS — straightforward.
Two habits avoid most mistakes. First, make the criteria range exactly as large as your conditions; an empty row inside it means "no condition" and every record is summed. Second, remember that text conditions match values beginning with that text — East also matches Eastern — so use ="=East" in the criteria cell for an exact match.
Examples
1Total sales for one region
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Region | Rep | Units | Sales | ||
| 2 | East | Ana | 40 | 5200 | 14690 | |
| 3 | West | Ben | 25 | 3100 | ||
| 4 | East | Carla | 55 | 7150 | ||
| 5 | North | Dev | 30 | 3900 | ||
| 6 | East | Eli | 18 | 2340 | ||
| 7 | West | Fay | 60 | 7800 | ||
| 8 | ||||||
| 9 | Region | |||||
| 10 | East |
Result: 14690
The criteria range A9:A10 says Region = East. Ana, Carla and Eli are in East: 5,200 + 7,150 + 2,340 = 14,690.
2Two conditions on one row (AND)
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Region | Rep | Units | Sales | ||
| 2 | East | Ana | 40 | 5200 | 12350 | |
| 3 | West | Ben | 25 | 3100 | ||
| 4 | East | Carla | 55 | 7150 | ||
| 5 | North | Dev | 30 | 3900 | ||
| 6 | East | Eli | 18 | 2340 | ||
| 7 | West | Fay | 60 | 7800 | ||
| 8 | ||||||
| 9 | Region | Units | ||||
| 10 | East | >30 |
Result: 12350
Both conditions share a row, so a record must be in East and have more than 30 units. Ana (40) and Carla (55) qualify; Eli (18) does not: 5,200 + 7,150 = 12,350.
3Conditions on separate rows (OR)
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Region | Rep | Units | Sales | ||
| 2 | East | Ana | 40 | 5200 | 25590 | |
| 3 | West | Ben | 25 | 3100 | ||
| 4 | East | Carla | 55 | 7150 | ||
| 5 | North | Dev | 30 | 3900 | ||
| 6 | East | Eli | 18 | 2340 | ||
| 7 | West | Fay | 60 | 7800 | ||
| 8 | ||||||
| 9 | Region | |||||
| 10 | East | |||||
| 11 | West |
Result: 25590
Each criteria row is an alternative: East or West. Everyone except Dev (North) is included: 14,690 + 3,100 + 7,800 = 25,590. The field is given by number here (4 = Sales).
4A range on one field
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Region | Rep | Units | Sales | ||
| 2 | East | Ana | 40 | 5200 | 12200 | |
| 3 | West | Ben | 25 | 3100 | ||
| 4 | East | Carla | 55 | 7150 | ||
| 5 | North | Dev | 30 | 3900 | ||
| 6 | East | Eli | 18 | 2340 | ||
| 7 | West | Fay | 60 | 7800 | ||
| 8 | ||||||
| 9 | Sales | Sales | ||||
| 10 | >=3000 | <=6000 |
Result: 12200
Repeating the heading lets you set a lower and an upper limit on the same row. Sales between 3,000 and 6,000: Ana 5,200 + Ben 3,100 + Dev 3,900 = 12,200.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | The field text does not match any header in the list (e.g. "Sale" instead of "Sales"). | Copy the header exactly, or use the column number. |
Total of everything | The criteria range includes an empty row, which matches every record. | Resize the criteria range so it covers only the heading and filled condition rows. |
Too much included | Text conditions match values that begin with the text (East matches Eastern). | Type ="=East" in the criteria cell for an exact match. |
Tips
- Criteria headings must match the list headings exactly (case does not matter, extra spaces do).
- Put the criteria range above the list or on a separate sheet, so new records added at the bottom of the list don't collide with it.
- Criteria cells can contain formulas, such as
=">"&H1to compare with a threshold stored in H1, or=">="&DATE(2026,1,1)for dates.
Questions
Should I use DSUM or SUMIFS?
SUMIFS is simpler for AND conditions written into the formula. DSUM is better when conditions should be edited in cells by other users, or when you need OR logic across different columns, which SUMIFS cannot do in a single call.
How do I write an OR condition in DSUM?
Put each alternative on its own row of the criteria range and include all those rows in the criteria argument.
Can DSUM use wildcards?
Yes. In a text condition * stands for any characters and ? for one character, e.g. *cable matches every item ending in cable.
Google Sheets
DSUM also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
DSUM 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 | DSUMA |
| Dutch | DBSOM |
| Finnish | TSUMMA |
| French | BDSOMME |
| German | DBSUMME |
| Hungarian | AB.SZUM |
| Italian | DB.SOMMA |
| Norwegian (Bokmål) | DSUMMER |
| Polish | BD.SUMA |
| Portuguese (Brazil) | BDSOMA |
| Portuguese (Portugal) | BDSOMA |
| Russian | БДСУММ |
| Spanish | BDSUMA |
| Swedish | DSUMMA |
| Turkish | VSEÇTOPLA |