Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Docs using multiple manual criterion in DSUM

Tags:

google-docs

How can I manually enter multiple criterion into a DSUM function?

I can have it check a single set of criterion with: =DSUM(J3:L55, "Charge", {"Category";"Coffee"})

However changing that to =DSUM(J3:L55, "Charge", {"Category";"Coffee";"Split";"Yes"} Causes it to just use the "Category";"Coffee" but and ignore the ;"Split";"Yes" section.

What is the syntax to set multiple criterion in google docs? I cannot really make a 2x2 table to each category I have (=DSUM(J3:L55, "Charge", D7:E8) ) and instead need to just manually enter the criterion.

DSUM with table criterion is in blue

DSUM with table criterion is in blue. I am selecting "Category" though "Split?" and want to use both Category and Split as criterion without having to resort to the darker blue table you see there

like image 342
Douglas Gaskell Avatar asked Nov 04 '14 01:11

Douglas Gaskell


People also ask

Can Dsum include multiple criteria?

Because DSUM uses a criteria range, it isn't suitable for use in multiple rows, but is a good choice for a single summary, and it can use complex criteria.

How do you do multiple criteria in Google Sheets?

You can use the ampersand to join columns and criteria to code a multiple criteria Sumif formula. The criteria can be from one column or two or more different columns.


2 Answers

Try

=DSUM(J3:L55, "Charge", {{"Category";"Coffee"},{"Split";"Yes"}})

like image 195
wim1969 Avatar answered Oct 13 '22 17:10

wim1969


Google updated the DSUM function. The update requires you to specify an array/table for criterion.
Where Column names and Criterion were named before, you now reference a table:
{F3,G4}
Where
"F3" and "G3" are the column names to be referenced.
"F4" and "G4" are the Test Values.
"F3" is Category
"G3" is Split?
"F4" is Coffee
"G4" is Yes
An example of the new formula is:
=DSUM(A1:E55, "Charge", {F3:G4})
I think this makes it easier to update the table and reference changes.
You can have multiple criteria, I tested it with "Equipment" and "Yes" by adding another row to my criterion table.

Reference: Google Help: DSUM()

The Old Way:
The correct syntax is to use commas to separate the columns.
{"Category","Split";"Coffee","Yes"}
{ Column1 , Column2 ; Test 1 , Test 2}
so your formula should be
=DSUM(J3:L55, "Charge", {"Category","Split";"Coffee","Yes"})

like image 21
Keybonesabi Avatar answered Oct 13 '22 17:10

Keybonesabi