GOOGLE SHEETS: SUMIF with multiple range columns and multiple sumrange columns?

slam

Well-known Member
Joined
Sep 16, 2002
Messages
771
I have a spreadsheet set out with 10 unique text entries in column A (row 2 through 11), and the same values in column C & E. In B, D, & F, I have a corresponding value that I am trying to sum. The easy solution is to put them all in one column, and use a basic sumif, but the spreadsheet needs to be laid out this way. How can I get it to work over multiple columns for both the range and sumrange? N2, N3, and so on is my criteria I'm matching it to. Here's where I'm at with the formula:

=sumif((A$2:A$11,C$2:C$11,E$2:E$11),N2,(B$2:B$11,D$2:D$11,F$2:F$11))

Anyone know what I'm doing wrong, or is this not possible with sumif?
 
Last edited:

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,080
Office Version
365
Platform
Windows
Re: SUMIF with multiple range columns and multiple sumrange columns?

You could do this:

=SUMPRODUCT(SUMIF(INDIRECT({"A$2:A$11","C$2:C$11","E$2:E$11"}),N2,INDIRECT({"B$2:B$11","D$2:D$11","F$2:F$11"})))

or simply add 3 sumif formulas together.
 

slam

Well-known Member
Joined
Sep 16, 2002
Messages
771
Re: SUMIF with multiple range columns and multiple sumrange columns?

You could do this:

=SUMPRODUCT(SUMIF(INDIRECT({"A$2:A$11","C$2:C$11","E$2:E$11"}),N2,INDIRECT({"B$2:B$11","D$2:D$11","F$2:F$11"})))

or simply add 3 sumif formulas together.
Well, that does indeed work perfectly in Excel, and I assumed it would in googlesheets too, but that's not the case :(
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,653
Office Version
365
Platform
Windows
Re: SUMIF with multiple range columns and multiple sumrange columns?

Well, that does indeed work perfectly in Excel, and I assumed it would in googlesheets too, but that's not the case
Is this an Excel or a Google Sheets problem? Note that they are NOT the same thing, and do not necessarily work the same.

If you post Google Sheets questions, be sure to mention that in the title and/or post, and it should be posted to the "General Excel Discussion & Other Questions" forum, and not the "Excel Questions" forum.
I can move this thread for you, if this in indeed a Google Sheets question.
 

slam

Well-known Member
Joined
Sep 16, 2002
Messages
771
Re: SUMIF with multiple range columns and multiple sumrange columns?

Is this an Excel or a Google Sheets problem? Note that they are NOT the same thing, and do not necessarily work the same.

If you post Google Sheets questions, be sure to mention that in the title and/or post, and it should be posted to the "General Excel Discussion & Other Questions" forum, and not the "Excel Questions" forum.
I can move this thread for you, if this in indeed a Google Sheets question.
Yes, my apologies for not specifying. I have access to both, which is why I was able to see it worked in Excel, but not googlesheets. I wouldn't have expected something like this would behave differently in each.

That said, I have found an alternative solution in googlesheets, by reworking the layout of data, so I don't need to pursue a solution any further. Thank you for your time.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,481
Messages
5,487,134
Members
407,580
Latest member
nilnil1

This Week's Hot Topics

Top