Database All versions ◉ 18 views

=DSUM()

In a list or database, DSUM provides the sum of the numbers in fields (columns) of records that match your specified conditions.

Applies To: Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016
=DSUM(database, field, criteria)
Hover argument names in the table for details.
Output typeNumber
Popularity35 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground Dedicated file for this function — safe & lightweight · sample data + live formulas
Share:

⬇ Download Sample Workbook

A dedicated .xlsx for =DSUM() with Persian sample data & live formulas — open in Excel and practice.

  • Sheet “Sample” — data table + formula in place
  • Sheet “Guide” — syntax, arguments & tips from this page
  • Instant & secure (token + rate limit)
Download DSUM.xlsx ~ 8–12 KB · No macros

⇪ Share

Send this function to friends

Quiz this function

%d questions — syntax, example & errors — test yourself!

◧ Arguments

ArgumentTypeRequiredDescription
database Range Required This is the range of cells that makes up the list or database. A database is a list of related data in which rows of related information are
records Number Optional , and columns of data are
fields Number Optional . The first row of a list contains labels for each column therein.
field Any type Required This specifies which column is used in the function. Specify the column label enclosed between double quotation marks, such as "Age" or "Yield," for example. Alternatively, you can specify a number (without quotation marks) that represents the position of the column within the list: e.g., 1 for the first column, 2 for the second column, and so on.
criteria Range Required This is the range of cells that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

▣ Examples

▦ Data
CellValue
A2 Tree
B2 Height
C2 Age
D2 Yield
E2 Profit
F2 Height
A3 ="=Apple"
B3 >10
F3 <16
A4 ="=Pear"
A5 .
A6 Tree
B6 Height
C6 Age
D6 Yield
E6 Profit
A7 Apple
B7 18
C7 20
D7 14
E7 $105
A8 Pear
B8 12
C8 12
D8 10
E8 $96
A9 Cherry
B9 13
C9 14
D9 9
E9 $105
A10 Apple
B10 14
C10 15
D10 10
E10 $75
A11 Pear
B11 9
C11 8
D11 8
E11 $77
A12 Apple
B12 8
C12 9
D12 6
E12 $45
A13 Tree
B13 Height
C13 Age
D13 Yield
E13 Profit
F13 Height
A14 ="=Apple"
B14 >10
F14 <16
A15 ="=Pear"
A16 .
A17 Tree
B17 Height
C17 Age
D17 Yield
E17 Profit
A18 Apple
B18 18
C18 20
D18 14
E18 $105
A19 Pear
B19 12
C19 12
D19 10
E19 $96
A20 Cherry
B20 13
C20 14
D20 9
E20 $105
A21 Apple
B21 14
C21 15
D21 10
E21 $75
A22 Pear
B22 9
C22 8
D22 8
E22 $77
A23 Apple
B23 8
C23 9
D23 6
E23 $45
The total profit from apple trees (rows 6, 9, and 11). =DSUM(A5:E11,"Profit",A1:A2)
Result: $225
The total profit from apple trees with a height between 10 and 16 feet, and all pear trees (rows 7, 9, and 10). =DSUM(A5:E11,"Profit", A1:F3)
Result: $248

§ Remarks

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount $10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • While the criteria range can be located anywhere on the worksheet, it is best to not place it below the list. This is risky. If you add more information to the list, the new information is added to the first row below the list. If the row below the list is not blank, Microsoft Excel will not add the new information.
  • Make sure that the criteria range does not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

✦ Tips

  • You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount $10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
  • While the criteria range can be located anywhere on the worksheet, it is best to not place it below the list. This is risky. If you add more information to the list, the new information is added to the first row below the list. If the row below the list is not blank, Microsoft Excel will not add the new information.
  • Make sure that the criteria range does not overlap the list.
  • To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

💬 Comments & Q&A 0 approved

🔒 Your comment will be published after review.

Share your thoughts — visible after admin approval

No comments yet — be the first!

✍️ Add comment / question

captcha
🔒 Your comment will be published after review.