Google Sheets: How to Use Multiple Sum Columns in DSUM Function

Published on

In an earlier tutorial, that about multiple criteria use in DSUM, I have promised to share with my readers about the use of multiple sum columns in DSUM.

Multiple sum columns mean how to use multiple fields, I’m referring to the argument ‘field’, in DSUM.

Syntax: DSUM(database, field, criteria)

If you know how to use the DSUM formula, then things will be easy for you. For that, first, you can go through my below DSUM function guide.

Must Check: How to Use the DSUM Function in Google Sheets.

Introduction

DSUM is a database Sum function, ‘D’ in DSUM stands for database, which works well with a structured table in Google Sheets and as well as in Excel.

On the contrary, the functions like SUMIF, SUMIFS, or SUMPRODUCT don’t require a structured table. You can just use a data range in these functions.

Understand what is a structured data table suitable for DSUM and what is a data range or dataset.

proper structured table for DSUM

Multiple Sum Columns in DSUM Function in Google Sheets

In order to Sum multiple columns using DSUM, follow the below generic formula in Google Sheets.

=sum(
     ArrayFormula(
        dsum(database,{field 1,field 2,field 3,...},criteria)
     )
)

In this field 1, field 2, field 3,… are the multiple columns. Also please note the use of the SUM and ArrayFormula functions.

In short, include fields (sum columns), that separated by a comma, within Curly Brackets and wrap the DSUM with ArrayFormula then Sum.

Here is one real-life example for the use of the multiple DSUM columns in Google Sheets.

Criteria within Multi-field DSUM

Multiple Sum Columns in DSUM

Formula:

=sum(
     ArrayFormula(
        dsum(A1:E7,{3,4,5},{"name";"Student 1"})
     )
)

When you closely analyze this formula, you can understand one thing.

The DSUM formula conditionally sums multiple column range, i.e. the range C2:E7 (column 3, 4, and 5). These columns are known as fields in DSUM.

Then what about the condition/criterion used?

The formula sums the fields “maths”, “physics”, “chemistry” if the field “name” contains “Student 1”. The formula sums the values in the shaded area (please refer to the above screen capture).

If you prefer to use the above DSUM criteria {"name";"Student 1"} as cell reference, then follow the below tips.

‘D’ Function Criteria as Range (Array)

Simply insert the criterion label “name” in cell G1 and criterion “Student 1” in cell G2 (both strings without quotes) then use the following DSUM.

=sum(
     ArrayFormula(
        dsum(A1:E7,{3,4,5},G1:G2)
     )
)

This way you can use multiple sum columns in DSUM function in Google Sheets.

Conclusion

In similar scenarios, you can use alternative functions like Sumif, Sumproduct, Query, etc. Here is that tutorial – How to Include Multiple Sum Columns in SUMIF in Google Sheets (formula options).

After learning the use of multiple column DSUM in Google Sheets, read the below two tutorials to get some advanced tips on ‘D’ functions.

Resources:

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

How to Easily Repeat a Sequence of Numbers in Excel

Excel offers multiple ways to accomplish tasks, and the simplicity of each approach depends...

Create a Sequence of Dates at Every Nth Row in Excel (Dynamic Array)

Would you like to create a sequence of dates in every nth row in...

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.