Database function

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)
ArgumentWhat it means
databaseRequiredThe list to search, including its header row, e.g. A1:D7. Each row is a record, each column a field.
fieldRequiredThe column to add: its header in quotes ("Sales") or its position in the list (4 for the fourth column).
criteriaRequiredA 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

F2fx=DSUM(A1:D7, "Sales", A9:A10)
ABCDEF
1RegionRepUnitsSales
2EastAna40520014690
3WestBen253100
4EastCarla557150
5NorthDev303900
6EastEli182340
7WestFay607800
8
9Region
10East

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)

F2fx=DSUM(A1:D7, "Sales", A9:B10)
ABCDEF
1RegionRepUnitsSales
2EastAna40520012350
3WestBen253100
4EastCarla557150
5NorthDev303900
6EastEli182340
7WestFay607800
8
9RegionUnits
10East>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)

F2fx=DSUM(A1:D7, 4, A9:A11)
ABCDEF
1RegionRepUnitsSales
2EastAna40520025590
3WestBen253100
4EastCarla557150
5NorthDev303900
6EastEli182340
7WestFay607800
8
9Region
10East
11West

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

F2fx=DSUM(A1:D7, "Sales", A9:B10)
ABCDEF
1RegionRepUnitsSales
2EastAna40520012200
3WestBen253100
4EastCarla557150
5NorthDev303900
6EastEli182340
7WestFay607800
8
9SalesSales
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.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 19 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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 everythingThe 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 includedText 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 =">"&H1 to 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.

LanguageFunction name
CzechDSUMA
DutchDBSOM
FinnishTSUMMA
FrenchBDSOMME
GermanDBSUMME
HungarianAB.SZUM
ItalianDB.SOMMA
Norwegian (Bokmål)DSUMMER
PolishBD.SUMA
Portuguese (Brazil)BDSOMA
Portuguese (Portugal)BDSOMA
RussianБДСУММ
SpanishBDSUMA
SwedishDSUMMA
TurkishVSEÇTOPLA