Function · Math

Excel DSUM function

The Excel DSUM function adds the numbers in a list that match a criteria range. Four travel expenses total $4,225, and Sales travel is $2,225.

Excel 365, Excel 2024, Excel 2021, Excel 2019, and earlier. Also in Excel for the web and Google Sheets.

Syntax =DSUM(database, field, criteria)

DSUM
=DSUM(A1:D8,"Amount",F1:F2)

Arguments

NameRequiredWhat to pass
databaseRequiredThe list, including the header row. The first row is the column labels. A range that leaves the header row out is #VALUE!.
fieldRequiredThe column to add. Use the header in quotes, such as "Amount", or the column's position inside the database. 4 is the fourth column of that range. The header match ignores case. Text in that column is skipped, so a text column such as Category adds to 0. A header that is not on the list, or a column number outside the list, including 0, is #VALUE!.
criteriaRequiredA small range whose first row repeats one or more headers from the list, with the conditions underneath. Conditions on the same row are AND. Another row is OR. A blank condition cell matches every value in that column. No matching row returns 0. * and ? are wildcards.

Examples

Travel expenses

=DSUM(A1:D8,"Amount",F1:F2)

Result $4,225

AND on one criteria row, OR on two rows

=DSUM(A1:D8,"Amount",F4:G5)

Result $2,225

January expenses and a dollar threshold

=DSUM(A1:D8,"Amount",F11:G12)

Result $3,815

No match, a blank condition, and a bad field

=DSUM(A1:D8,"Amount",F21:F22)

Result $0

=DSUM(A1:D8,"Amount",F1:F2)F4
Expenses
ABCDEF
1DateDeptCategoryAmountCategory
21/6/2026SalesTravel1250Travel
31/9/2026SalesMeals320
41/14/2026OpsTravel860$4,225
51/20/2026OpsSupplies410
61/27/2026SalesTravel975
72/3/2026OpsTravel1140
82/10/2026SalesSupplies185
A picture of the sheet, not a live calculator. The dates are real dates. The amounts are numbers. F1:F2 is the criteria, the header Category and the word Travel. Format the result as currency.

DSUM adds the numbers in one column of a list, but only on the rows that pass a criteria range. The list starts with a header row. The criteria range is a small block with one or more of the same headers and the conditions under them. It is the database version of SUMIFS, and it can do AND and OR in one formula.

The expenses are made up. Sales spent $1,250 on travel on 1/6/2026 and $320 on meals on 1/9/2026. Ops spent $860 on travel on 1/14/2026 and $410 on supplies on 1/20/2026. Sales spent $975 on travel on 1/27/2026. Ops spent $1,140 on travel on 2/3/2026. Sales spent $185 on supplies on 2/10/2026. =SUM(D2:D8) is $5,140.

Put the header Category in F1 and Travel in F2. =DSUM(A1:D8,"Amount",F1:F2) is $4,225. Amount is the fourth column of A1:D8, so =DSUM(A1:D8,4,F1:F2) is the same $4,225. The header match ignores case, and lowercase travel matches Travel. =SUMIFS(D2:D8,C2:C8,"Travel") is $4,225. SUMIF of Travel is $4,225. DCOUNT of the same criteria is 4.

Conditions on the same criteria row are AND. Dept Sales and Category Travel on one row is $2,225, the $1,250 and the $975. =SUMIFS(D2:D8,B2:B8,"Sales",C2:C8,"Travel") is $2,225. A second criteria row is OR. Meals on one row and Supplies on the next is $915. Sales with Travel on one row and Ops with Supplies on the next is $2,635. That mix is one DSUM. SUMIFS needs one call per row, added together.

Write a date criterion with DATE. For January, use the Date header twice on one criteria row, with =">="&DATE(2026,1,1) under one and ="<="&DATE(2026,1,31) under the other. That is $3,815, the five January expenses. A dollar threshold works the same way. The text >1000 under Amount is $2,390.

No matching row, such as Lodging, is $0 rather than an error. A blank cell under the criteria header matches every row, so DSUM is $5,140, the whole list. * stands for any run of characters and ? for one character. In Excel, a plain text condition also matches longer text that starts with it. Type ="=Travel" in the criteria cell when only the whole word should match. The field Category adds to 0, because categories are text. The field Cost is #VALUE!. Field number 0 is #VALUE!. Leave the header row out of the database, =DSUM(A2:D8,"Amount",F1:F2), and the result is #VALUE!.

DSUM works in every Excel version, including Excel 365, 2024, 2021, 2019, and older desktop versions. DGET returns one value when exactly one row matches. SUMPRODUCT adds with tests written as arrays. FILTER in Excel 365 and 2021 spills the matching rows, and SUM of that spill is the same total. SUBTOTAL adds only the rows a filter leaves visible. xl.group.sum spills every category with its total at once.

The Petty Cash Log adds its category totals with SUMIFS, and Delivery is the largest category at $102.25. The Small Business Bookkeeping workbook adds its month totals with SUMIFS. A DSUM with a criteria block does the same job when you want the conditions on the sheet where anyone can change them.