How to Use Excel DSUM Function: 4 Methods - ExcelDemy (2024)

Method 1 – Using DSUM as a Function

Like all other functions, DSUM is an Excel function, and it works as such. You just have to declare the arguments as instructed by the syntax.

Paste the following formula in any blank cell (i.e., G5:H5) to calculate the sum of the Unit Price field.

=DSUM(B8:H19,"Unit Price",B5:C6)

Inside the formula,

B8:H19; is the range.

“Unit Price”; is the specified field in which you calculate the sum.

B5:C6; range where specific criteria exist.

How to Use Excel DSUM Function: 4 Methods - ExcelDemy (1)

Press ENTER. The evaluated value will appear.

By the formula, we impose two criteria

⏩ Sum Unit Price of Order IDs greater than 10021.

⏩ Sum Unit Price of Quantity sold greater than or equal to 120.

How to Use Excel DSUM Function: 4 Methods - ExcelDemy (2)

The DSUM function evaluates $3.74. It sums the favorable entries (i.e. $1.87 and $1.87) and results in ($1.87+$1.87) $3.74.

Depending on your data types, you can use different criteria, and the DSUM function works just fine.

Method 2 – Applying DSUM to Calculate the Total Sum in Excel (Single Criterion)

Similar to the SUM function, the DSUM function can calculate the total sum of any Field (i.e., Any Column). We calculate the Total Price of every sold product from the dataset.

Write the below formula in any cell (i.e., G5:H5).

=DSUM(B8:H19,"Total Price",B5:C6)

In the formula,

B8:H19; indicates the range.

“Total Price”; indicates the specified field in which you calculate the sum.

B5:C6; refers to the range where specific criteria exist.

How to Use Excel DSUM Function: 4 Methods - ExcelDemy (3)

Hit ENTER. Afterward, the total sum value will appear.

The formula imposes only one criterion

⏩ To sum the Total Price of Order IDs equal to or less than 10017 that means all the entries in the dataset.

How to Use Excel DSUM Function: 4 Methods - ExcelDemy (4)

The resultant value of the formula is $2033.01. It sums all the entries in the Total Price column. You can use other headers as fields to come up with the total sum.

Method 3 – Using DSUM Function in Excel to Calculate Sum (Multiple Criteria)

From the prior example (i.e., Example 2), we learn the DSUM function works similarly to the SUM function. But what if we just want to sum up a specific field that complies with multiple conditions?

In this scenario, we impose four criteria in a range (i.e., B5:E6) and DSUM sums entries of the Total Price field which have

Order ID equal to or greater than 10017.

⏩ Region East.

⏩ Positioned in the Cookies category.

⏩ Identified as Arrow Root Product.

Write the following formula in any cell (i.e., G5:H5).

=DSUM(B8:H19,"Total Price",B5:E6)

The references declare the same arguments as they do in previous examples. All the criteria sit in the B8:H19 range, as we can see.

The formula matches every specified field to criteria and moves rightward to match appropriate entries finally.

How to Use Excel DSUM Function: 4 Methods - ExcelDemy (5)

Press ENTER. The aggregate value appears.

How to Use Excel DSUM Function: 4 Methods - ExcelDemy (6)

The formula finally matches 3 entries that comply with the imposed conditions and returns a value of $695.42.

If we cross-check the resultant value with matched entries, the value appears to be the same ($318.28+$303.02+$74.12) $695.42.

Method 4 – Applying DSUM Function in Excel VBA Macros

Use the DSUM function in VBA Macro codes. Following the Macro DSUM function format, we can mimic any previous article examples.

LWant the sum of the Total Price of every entry in the dataset.

Hit ALT+F11 altogether. Microsoft Visual Basic Window opens up. In the Microsoft Visual Window, Select Insert > Choose Module.

How to Use Excel DSUM Function: 4 Methods - ExcelDemy (7)

In the Module, Paste the following Maco code, then Hit F5 to run the code.

Sub ExcelDSUMFunction()Range("F5:G5").Value = Application.WorksheetFunction.DSum(Range("B8:H19"), "Total Price", Range("B5:C6"))End Sub

How to Use Excel DSUM Function: 4 Methods - ExcelDemy (8)

In the Macro code,

“F5:G5”; indicates where the resultant value will sit.

Back to the worksheet and see the sum of Total Price entries in cell F5:G5.

How to Use Excel DSUM Function: 4 Methods - ExcelDemy (9)

Differentiate SUMIF, SUMIFS, and DSUM:

AspectsSUMIFSUMIFSDSUM
SyntaxSUMIF(range, criteria, [sum_range]) SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)

DSUM(database, field, criteria)

DatabaseConditional Function Conditional Function A database Function
FormationNo Particular Formation is NeededNo Particular Formation is NeededRequires Field Labels to Operate
Imposing CriteriaSingle Criterion can be Inserted Inside or Outside the FormulaMultiple Criteria can be Inserted Inside or Outside the Formula and Look messy but Flexible. Criteria are Defined Outside or Inside the Formula and Look Clean
Handling Multiple Criteria in the Same Position

Not Applicable

Unable to Handle Multiple Criteria in the Same Position Handles with Ease
UnderstandingComparatively Easier to Understand than SUMIFS Function Harder to Understand and Apply Easily Understood
Building Complex Criteria Custom Complex Criteria Building is Hard Very East to Build Custom Complex Criteria Hard to Build Custom Complex Criteria

⧭ DSUM Function in Excel: Things to Keep in Mind

The criteria range can be anywhere in the worksheet. However, it is preferred not to place criteria range in positions like overlapping with the dataset, and below the dataset.

If DSUM has to perform to the whole dataset, place a blank line below the header of the criteria range.

Any range of criteria can be used if it consists of at least one column field and one condition.

Download Excel Workbook

Uses of Excel DSUM Function.xlsm

Excel DSUM Function: Knowledge Hub

  • How to Use DSUM Function with Dynamic Criteria in Excel
  • Excel DSUM vs SUMIF Functions

<< Go Back to Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
How to Use Excel DSUM Function: 4 Methods - ExcelDemy (2024)

FAQs

How do you use the dsum function in Excel? ›

=DSUM(database, field, criteria)

The DSUM function uses the following arguments: Database (required argument) – This is the range of cells wherein the first row of the database specifies the field names. Field (required argument) – This is the column within the database that will be summed.

Why is my dsum formula not working? ›

Cause. This problem occurs because the field parameter of the DCOUNT and DSUM functions cannot use a cell reference or a column label to retrieve data from the database table.

Can the DSUM function include multiple criteria? ›

The DSUM function allows you to specify multiple criteria across multiple columns. It is especially useful when dealing with large databases where you want to summarize data that meets certain criteria across different fields. The SUMIF function is used to sum values in a range that meets the criteria that you specify.

What is the difference between dsum and sumifs in Excel? ›

DSUM requires column headers for both the range and criteria whereas SUMIFS doesn't require column headers. That is why excel uses the term database in connection with DSUM as database means that column headers should exist. Also it mentions fields which means headers.

How do you enter a formula using the sum function and 3 D references? ›

Skill Refresher
  1. Click on the cell where you want the 3-D SUM to appear.
  2. Type =SUM(
  3. Click on the leftmost sheet in the group of sheets you want to sum.
  4. Hold the SHIFT key down and click on the rightmost sheet in the group of sheets you want to sum.
  5. Click on the cell in the sheet you're in that you want to sum.

How do you use Excel functions? ›

Enter a formula that contains a built-in function

Type an equal sign = and then type a function. For example, =SUM for getting the total sales. Type an opening parenthesis (. Select the range of cells, and then type a closing parenthesis).

Why Excel auto sum is not working? ›

Under "Editing," make sure "Enable AutoSum" is checked. Click "Customize Status bar" and verify that the desired calculations (e.g., Sum, Average, Count) are selected.

Why is Excel not recognizing my formula? ›

When Excel formulas are not updating automatically, most likely it's because the Calculation setting has been changed to Manual instead of Automatic. To fix this, just set the Calculation option to Automatic again.

What is the criteria range for Dsum in Excel? ›

You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.

How do I sum all values that match multiple criteria in Excel? ›

You use SUMIFS in Excel to find a conditional sum of values based on multiple criteria. The SUMIFS function was introduced in Excel 2007 and is available in all subsequent versions of Excel 2010, 2013, 2016, 2019, 2021, and Excel 365.

How do you sum unique values based on criteria in another column in Excel? ›

If you want, you can apply the criteria to one range and sum the corresponding values in a different range. For example, the formula =SUMIF(B2:B5, "John", C2:C5) sums only the values in the range C2:C5, where the corresponding cells in the range B2:B5 equal "John."

How do I count multiple criteria in the same range in Excel? ›

How to Countif Multiple Criteria? The Excel formula to countif multiple criteria[1] is =countifs(). The “s” on the end makes it plural and, therefore, implies that there are multiple criteria (2 or more).

Is dsum faster than sumif? ›

But let's face it: Setting up the PivotTable in the first place is the easiest of any of these approaches, so it has my vote. The DSUM approach is 12 times faster than SUMPRODUCT. That's not as good as SUMIFS, but it's still a significant improvement.

What is the better formula than Sumifs? ›

An alternative to the SUMIFS function in Excel is the SUMPRODUCT function. It allows you to apply multiple criteria to different ranges and return the sum of corresponding values that meet those criteria.

Should I use pivot tables or Sumifs? ›

pivot only calculates when refreshed unlike sumif which calculates every changes made in the data.

How do you use the summation function in Excel? ›

Type =SUM in a cell, followed by an opening parenthesis (. To enter the first formula range, which is called an argument (a piece of data the formula needs to run), type A2:A4 (or select cell A2 and drag through cell A6). Type a comma (,) to separate the first argument from the next.

How do I connect to Active Directory from Excel? ›

In Excel, open the Data tab and choose Get Data -> Legacy Wizards -> From Microsoft Query (Legacy). Choose the ActiveDirectory DSN. Select the option to use Query Wizard to create/edit queries. In the Query Wizard, expand the node for the table you would like to import into your spreadsheet.

How to use Excel for database management? ›

How to Create a Database in Excel
  1. Step 1: Set up a data spreadsheet framework. Open an Excel spreadsheet, place your cursor in the A1 cell, and type in your database title. ...
  2. Step 2: Add or import data. ...
  3. Step 3: Convert your data into a table. ...
  4. Step 4: Format the table. ...
  5. Step 5: Save your database spreadsheet.
Apr 2, 2024

How do I use database formulas in Excel? ›

Excel database functions
  1. =DSUM: Add numbers in a field (i.e., table column) that match specific conditions.
  2. =DCOUNT: Count # cells in a field (i.e., a table column) that match specific conditions.
  3. =DCOUNTA: Same, but only for nonblank cells.
  4. =DGET: Extracts single row from table that matches specific conditions.

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Terrell Hackett

Last Updated:

Views: 5860

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.