Returns the sum of the values in the specified column of the specified database that match the specified criteria.
Syntax Copy Code |
---|
DSUM( Database database, TextOrNumber field, Reference criteria ) → Number |
You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell underneath the column label for specifying the condition.
The following table shows a small database for a grocery shop. Each record in the table contains information about one item. Above the database are several cells that contain the conditions used as the function criteria.
NAME | CATEGORY | PRICE | PRICE | |
| Beverages | >10 | <15 |
|
| Confections |
|
|
|
Name | Category | Weight | Qty | Price |
Blueberry Tea | Beverages | 400 | 12 | 12.50 |
Ipoh Cofee | Beverages | 500 | 20 | 18.00 |
Chocolade | Confections | 1250 | 10 | 22.45 |
Steeleye Stout | Beverages | 750 | 6 | 7.95 |
Scottish Longbreads | Confections | 450 | 8 | 11.50 |
Mascarpone | Dairy | 250 | 2 | 7.50 |
The following formula will return the sum of all prices of beverages in the table:
Formula Copy Code |
---|
=DSUM(A4:E10,"Price",B1:B2) |
Function Reference
DGET Function
DAVERAGE Function
DCOUNT Function
DCOUNTA Function
DPRODUCT Function
DMAX Function
DMIN Function
DSTDEV Function
DSTDEVP Function
DVAR Function
DVARP Function