Related Function:

The DSUM function adds the numbers in a field (column) of records in a list or database that match conditions that you specify.

Syntax

=DSUM(database,field,criteria)

Arguments

Argument Description
database The range of cells that makes up the list or database
field Indicates which column is used in the function

  The field can either be a field number, or can be the field name, i.e. the header in the top row of the database, encased in quotes, e.g. “Area”, “Quarter”, etc
criteria The range of cells that contains the conditions that you specify

  The range can include one or more criteria, which are presented as a field name in one cell and the condition for that field in the cell below, e.g.

Gender Age
Male >10

Note: The criteria supplied beneath each field heading can be either:

  • a numeric value, including an integer, decimal, date, time, or logical value, e.g. 10, 01/01/2010, FALSE
  • a text string, e.g. “Name”, “Tuesday”
  • an expression, e.g. “>10”, “<>0”).

The Excel database functions are not case sensitive. So, for example, the criteria =”Math” will be satisfied by cells containing the text “Math” or “math”.

Examples

  A B C D E F G H
1 Quarter Region Agent Sales   Agent Quarter  
2 1 North Norton $222,100   S* 4  
3 1 North Sam $252,280        
4 1 East Sarah $222,100        
5 2 North Norton $251,280        
6 2 South Sam $229,785        
7 2 East Sarah $232,190        
8 3 North Norton $294,820        
9 3 South Sam $273,139        
10 3 East Sarah $219,167        
11 4 North Norton $258,142        
12 4 South Sam $265,180        
13 4 East Sarah $266,132        
14                
15 Formula Result Notes
16 =DSUM(A1:D13,”Sales”,F1:G2) $531,312 Returns the sum of values from the “Sales” column for the 4th quarter for agents names beginning with”S”

Note: You can also use the following wildcards in text-related criteria arguments:

      ?  –  matches any single character
  *  –  matches any sequence of characters

eg. the condition “A*e” will match any substring beginning with “A” and ending in “e”

If you do actually want to find the ? or * character, type the ~ symbol before this character in your search.