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:


AB
CD
1
DATE:01/12/2014
2CURRENCY:USD
GBPEUR
3COUNTRY:United Kingdom
Overseas
4
5DATECURRENCYCOUNTRYAMOUNT
601/12/2014USDOverseas100
701/12/2014GBPOverseas50
801/12/2014USDOverseas45
901/12/2014EURUnited Kingdom98
1002/12/2014GBPOverseas67
1102/12/2014EURUnited Kingdom101
1202/12/2014USDUnited Kingdom73
1302/12/2014USDOverseas20
1402/12/2014GBPOverseas107
1503/12/2014GBPOverseas55
1603/12/2014GBPUnited Kingdom42
1703/12/2014EURUnited Kingdom89

<tbody>
</tbody>


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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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,216,226
Messages
6,129,605
Members
449,520
Latest member
TBFrieds

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