DSUM Function: How to Sum with Complex Conditions in Excel

In the basic Excel functions , the DSUM function is one of the most popular functions. This function will calculate the sum of a field or a column to satisfy the conditions you set in the data table. The formula for using the DSUM function as well as the way to calculate the conditional sum of the function is relatively simple and faster than the SUMIF function on Excel . The following article will guide readers on how to use the DSUM function on Excel to calculate the sum of columns with given conditions.

 

  1. How to use the SUM function to calculate the sum in Excel
  2. Instructions for creating interactive charts in Excel with the INDEX function
  3. How to use Vlookup function in Excel

Formula of DSUM function in Excel

The DSUM function is a function that adds numbers in a field or column in a data list that satisfy specified conditions. The function syntax is =DSUM(database; field; criteria) .

 

In there:

  1. Database : is the database range containing the column to be summed and the column to be checked for the condition. The list contains the first row as the column header.
  2. Field: is a required argument that specifies the name of the column used to sum the data. You can enter the column title in double quotes, or use a number representing the column position in the list without double quotes, or refer to the column title you want to sum.
  3. Criteria: is a required argument, the range of cells containing the condition you want the DSUM function to check.

User Note:

  1. Any range can be used for criteria if the range contains at least 1 column label and at least 1 cell below the column heading that will define the conditions for that column.
  2. Do not place the condition range at the bottom of the list because there will be no place to add more information to the list.

Example of using the DSUM function to calculate conditional sum

We will process the data table as shown below.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 1

 

Example 1. Calculate the total amount sold of iPhone products

Step 1:

First we create a condition range for the DSUM function to calculate the total amount sold of iPhone products. The condition for the DSUM function is iPhone*.

Note: Use * to represent other characters.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 2

Step 2:

Next, the user enters the DSUM function formula as =DSUM(A6:E13;"Total Amount";C2:C3) .

In there:

  1. A6:E13 is the database range containing the column to sum and the column containing the condition to check.
  2. 'Total' is the column heading that will use the value in that column to calculate the total.
  3. C2:C3 is the condition range containing column headers and 1 condition value.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 3

 

Press Enter and we will get the exact result as shown.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 4

Or the user can replace the value in Field with a reference to the Total column. The input formula is =DSUM(A6:E13;E6;C2:C3) . The result is the same as when you enter the Total column into the formula.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 5

Example 2. Calculate the total amount of products sold with quantity greater than or equal to 5.

Step 1:

First user will also need to create condition range with column header Sales Quantity and condition value is >=5 as shown below.

 

DSUM Function: How to Sum with Complex Conditions in Excel Picture 6

Step 2:

We enter the function formula =DSUM(A6:E13;E6;C2:C3) and press Enter.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 7

The total amount will be as shown in the picture.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 8

In general, using the DSUM function in Excel is very simple. You can use the function to calculate the sum of values in columns with simple conditions. With more complex conditions, we can use the SUMIF function.

See also:

  1. Instructions for using the Index function in Excel
  2. 3 ways to calculate sum in Excel
  3. How to print Excel spreadsheet in one page

Good luck!

5 ★ | 2 Vote

May be interested