ID EN
#Database

DSUM

Excel Functions

Get sum from matching records

Syntax

EXCEL
=DSUM(database, field, criteria)

Arguments

Parameter Description
database Database range including headers.
field Field name or index to count.
criteria Criteria range including headers.

Return Value

The calculated sum

Details

The Excel DSUM function calculates a sum of values in a set of records that match criteria. The values to sum are extracted from a given field in the database, specified as an argument. The database argument is a range of cells that includes field headers. The field is the name or index of the field to query, and the criteria is a range of cells with headers that match those in database. Note that field can be specified with a name or index. Using the example above, you can get the sum of all "Blue" sales with either of the formulas below: The criteria can include a variety of expressions, including some wildcards. The table below shows some examples: Note: support for wildcards is not as extensive as with other functions like COUNTIFS, SUMIFS, MATCH, etc. For example, the pattern "???" wi

Examples

Example 1

The Excel DSUM function calculates a sum of values in a set of records that match criteria. The values to sum are extracted from a given field in the

EXCEL
=DSUM(B7:D13,"Sales",B4:D5) // field by name
=DSUM(B7:D13,3,B4:D5) // field by index

See Also

DCOUNT DCOUNTA DMIN DMAX DPRODUCT