The DSUM function adds numbers in a database that meets a condition or criteria.
Formula in cell B15:
=DSUM(B5:D12, 3, B2:D3)
The formula adds numbers from column 3 (D) with the condition that the size is L and Item is not equal to a string that begins with B.
Row 7 and 12 matches, 690 + 623 = 1313.
Excel Function Syntax
database, field, criteria) Arguments
database Required. The cell reference to a list or database.
field Required. The field argument lets you choose which column to use. You can use the column name enclosed with double quotation marks or the corresponding column number.
criteria Required. A cell reference to the criteria range. The criteria range needs to have column labels and at least one condition below the column label.
Excel defines a database as a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.
Allowed criteria range characters are less than and greater than signs <>, use them to specify a criteria range. Also, asterisks * can be used to match partial strings.
You can place your criteria range wherever you want on your worksheet, however, it is not recommended below the list/database. The function needs a blank row below the list to work properly.
To include the entire list/database enter a blank line below the criteria range column labels.
The DSUM function function is one of many functions in the 'Database' category.