What Does DSum Do In Excel?

Dsum queries your Excel data and provides answers based on the criteria that you provide to the dsum function.

More to the point in order to use dsum you have to decide to layout your spreadsheet using best practice spreadsheet design principles.

Get the spreadsheet used in the tutorial above.

In a nutshell that is data that is tabular with row headings and you do not mix up data and reports i.e. all report sheets are fed by data sheets like the one below and reports never ever link to other reports.

Figure 1
spreadsheet table for dsum

The spreadsheet design above is perfect for a dsum function and is the way that I recommend that you lay out your data in general.

I explain the excel dsum function in detail in the youtube video further down on this page.

Dsum Case Study

I want the total volume of shares traded on the NYSE only on Fridays for the ticker "bac" for the data set in the spreadsheet.

This is perfect for a dsum function because dsum can behave like a complex autofilter or sql query.

Figure 2
dsum function with autofilter verification

The dsum function in figure 2 is acting on the data in figure 1, this data has range name "StockData" and we are summing the "Volume" column using the criteria that has the range name "VolumeCriteria".

Notice that the top row of the criteria in figure 2 has column headers with the second row having the criteria in a "query by example" layout.

I then verify (check digit) the result of the dsum by using a subtotal function.

=subtotal(9,G:G)

Subtotal column G (9 means use sum), This means that the function will only total the visible cells so that when you apply the autofilter the totals change to represent the filtered data.

Download the spreadsheet from this YouTube example

Thanks for reading this post

If you have any queries or comments please leave them below as they help to improve the quality of the information that I provide.

If you found this article useful then don't forget to share it by clicking on one of the social media buttons below.

Leave a Reply

Your email address will not be published. Required fields are marked *