How to SUM multiple {SUM(SUMIFs)} array formulas? (SUM an array of arrays)

Mr Mongolia

New Member
Joined
Dec 11, 2014
Messages
2
This is my first thread so go easy on me..

I want to add multiple SUM(SUMIFS(...)) array formulas, without having to manually type SUM(SUMIFS(...))+SUM(SUMIFS(...))+ etc

Is there a way to SUM an array of array formulas?

----------------------------------------
My specific example:

[TABLE="width: 405"]
<tbody>[TR]
[TD="align: center"]
[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD]DATE:[/TD]
[TD="align: center"]01/12/2014[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]CURRENCY:[/TD]
[TD="align: center"]USD
[/TD]
[TD="align: center"]GBP[/TD]
[TD="align: center"]EUR[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]COUNTRY:[/TD]
[TD="align: center"]United Kingdom
[/TD]
[TD="align: center"]Overseas[/TD]
[TD="align: center"]
[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD]DATE[/TD]
[TD]CURRENCY[/TD]
[TD]COUNTRY[/TD]
[TD]AMOUNT[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: right"]01/12/2014[/TD]
[TD="align: center"]USD[/TD]
[TD]Overseas[/TD]
[TD="align: center"]100[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: right"]01/12/2014[/TD]
[TD="align: center"]GBP[/TD]
[TD]Overseas[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: right"]01/12/2014[/TD]
[TD="align: center"]USD[/TD]
[TD]Overseas[/TD]
[TD="align: center"]45[/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: right"]01/12/2014[/TD]
[TD="align: center"]EUR[/TD]
[TD]United Kingdom[/TD]
[TD="align: center"]98[/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: right"]02/12/2014[/TD]
[TD="align: center"]GBP[/TD]
[TD]Overseas[/TD]
[TD="align: center"]67[/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD="align: right"]02/12/2014[/TD]
[TD="align: center"]EUR[/TD]
[TD]United Kingdom[/TD]
[TD="align: center"]101[/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD="align: right"]02/12/2014[/TD]
[TD="align: center"]USD[/TD]
[TD]United Kingdom[/TD]
[TD="align: center"]73[/TD]
[/TR]
[TR]
[TD="align: center"]13[/TD]
[TD="align: right"]02/12/2014[/TD]
[TD="align: center"]USD[/TD]
[TD]Overseas[/TD]
[TD="align: center"]20[/TD]
[/TR]
[TR]
[TD="align: center"]14[/TD]
[TD="align: right"]02/12/2014[/TD]
[TD="align: center"]GBP[/TD]
[TD]Overseas[/TD]
[TD="align: center"]107[/TD]
[/TR]
[TR]
[TD="align: center"]15[/TD]
[TD="align: right"]03/12/2014[/TD]
[TD="align: center"]GBP[/TD]
[TD]Overseas[/TD]
[TD="align: center"]55[/TD]
[/TR]
[TR]
[TD="align: center"]16[/TD]
[TD="align: right"]03/12/2014[/TD]
[TD="align: center"]GBP[/TD]
[TD]United Kingdom[/TD]
[TD="align: center"]42[/TD]
[/TR]
[TR]
[TD="align: center"]17[/TD]
[TD="align: right"]03/12/2014[/TD]
[TD="align: center"]EUR[/TD]
[TD]United Kingdom[/TD]
[TD="align: center"]89[/TD]
[/TR]
</tbody>[/TABLE]


The array formula I currently have is;

{=SUM(SUMIFS(D5:D16,A5:A16,B1,B5:B16,B2:D2))}

i.e. the SUM of each SUMIFS based on Date and Currency - in this instance all currencies on the 01/12/14 = 293 (100+50+45+98).

I now need to include a third criteria in my SUMIFS to be based on the Country, but if I add;

{=SUM(SUMIFS(D5:D16,A5:A16,B1,B5:B16,B2:D2,C5:C16,B3:C3))}

It only SUMs the SUMIFS for USD and United Kingdom + GBP and Overseas giving me 50 instead of the total 293.

I realise for this example both formulas give the same answer, but I need the flexibility in this formula to be able to apply it to many different data sets, as the criteria lists are set to change dynamically depending on several other factors.

I could just type;

{=SUM(SUMIFS(D5:D16,A5:A16,B1,B5:B16,B2:D2,C5:C16,B3))+SUM(SUMIFS(D5:D16,A5:A16,B1,B5:B16,B2:D2,C5:C16,C3))}

But when I have over 50 different countries this will be extremely time consuming.

Is there a better way?

Thanks
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
When doing multi criteria array sum(sumifs..

And you need 2 sets of multi critera, those 2 sets of criteria must be transposed of each other. (1 a column, the other a row)

{=SUM(SUMIFS(D5:D16,A5:A16,B1,B5:B16,B2:D2,C5:C16,B3:B4))}
or
{=SUM(SUMIFS(D5:D16,A5:A16,B1,B5:B16,B2:D2,C5:C16,TRANSPOSE(B3:C3)))}

Also, you can change SUM to SUMPRODUCT so you don't have to enter as CSE
=SUMPRODUCT(SUMIFS(D5:D16,A5:A16,B1,B5:B16,B2:D2,C5:C16,TRANSPOSE(B3:C3)))
 
Upvote 0
Transpose it... so simple! Yes that works perfectly, thank you Jonmo1!

(Although I don't think the SUMPRODUCT works with the transposed array - CSE works fine though)

Out of interest, is there a way of doing this with a third array criteria?
 
Upvote 0
Not that I'm aware of.
It might be time to start using helper columns (they're not a bad thing)
Or use a pivot table as suggested by gsiestek

For the helper column method, you could do something like this based on your original formula with just 1 criteria array
{=SUM(SUMIFS(D5:D16,A5:A16,B1,B5:B16,B2:D2))}

in say G5 and filled down, put
=ISNUMBER(MATCH(B5,B$2:D$2,0))

Then use the regular sumifs (non array entered)
SUMIFS(D5:D16,A5:A16,B1,G5:G16,TRUE)
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top