Summing area of data across multiple tabs with multiple criteria-array and indirect?

bladz1454

New Member
Joined
Jan 21, 2015
Messages
16
Full disclosure this is a cross-forum thread (excelgure.ca) since I need to find a solution quickly!

https://www.excelguru.ca/forums/sho...abs-with-multiple-criteria-array-and-indirect

Hi Everyone, I'm spinning my wheels here between index match and sumproduct arrays but I think the indirect for multiple tabs is whats killing me. Here's the scenario, I have a GL data dumps (one tab for each month) and I need to map the GL account to the financial statement line items. Sounds simple but there are multiple 'stores' in each GL as well and for some reason when I use indirect its not working for the tabs (I'm using tab names instead of tables for the indirect reference). Another thing that I think always clouds my mind is I like to create formulas I can 1) Drag and 2) easily use in the future by adding data... I've also attached a sheet for reference - located in other forum since Mr Excel doesnt let you add files.

Thanks so much in advance!

Raw data in tabs (two tabs for two months as example):

Tab - January
GL AccountStore AStore BStore C
5011 · Apples10.0011.0015.00
5012 · Bananas20.0012.0016.00
5013 · Grapes30.0013.0017.00
5014 · Water40.0014.0018.00
Tab - February
GL AccountStore AStore BStore C
5011 · Apples15.0016.0020.00
5012 · Bananas25.0017.0021.00
5013 · Grapes35.0018.0022.00
5014 · Water45.0019.0023.00

<tbody>
</tbody>


Mapping from GL to Financials:
GL NameStatement Name
5011 · ApplesRevenue - Fruit
5012 · BananasRevenue - Fruit
5013 · GrapesRevenue - Fruit
5014 · WaterRevenue - Drinks

<tbody>
</tbody>


Final Product(s):

Financial Summary - January
Store AStore BStore C
Revenue - Fruit60.0036.0048.00
Revenue - Drinks40.0014.0018.00
Financial Summary - February
Store AStore BStore C
Revenue - Fruit75.0051.0063.00
Revenue - Drinks45.0019.0023.00

<tbody>
</tbody>

 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Not directly applicable but you may be able to chop it up. I've got a sheet with a variable number of sheets for projects. The list of projects that needs adding up is a dynamic range, on each sheet in cell Y2 is a value selected from a dropdown (a cost centre in this case) and this code adds up the value of cell F9 in each project sheet where the sheet has a particular cost centre selected in Y2 that matches the cost centre in the target sheet in $L$1:
Code:
=SUMPRODUCT(SUMIFS(INDIRECT("'"&ListProjects&"'!"&CELL("address",F9)),INDIRECT("'"&ListProjects&"'!$Y$2"),$L$1))
it works because the array values are in a dynamic list that INDIRECT turns into an array
 
Last edited:
Upvote 0
Not directly applicable but you may be able to chop it up. I've got a sheet with a variable number of sheets for projects. The list of projects that needs adding up is a dynamic range, on each sheet in cell Y2 is a value selected from a dropdown (a cost centre in this case) and this code adds up the value of cell F9 in each project sheet where the sheet has a particular cost centre selected in Y2 that matches the cost centre in the target sheet in $L$1:
Code:
=SUMPRODUCT(SUMIFS(INDIRECT("'"&ListProjects&"'!"&CELL("address",F9)),INDIRECT("'"&ListProjects&"'!$Y$2"),$L$1))
it works because the array values are in a dynamic list that INDIRECT turns into an array

Thanks, but I think what I'm doing it a bit different in regards to reading multiple ranges.

Anyone else?
 
Upvote 0
Sorry does anyone know if this might be easier if I just drag all the data into a single tab too?
 
Upvote 0
Try
Sheet

Finacials

B4=SUMPRODUCT((January!$A$2:$A$5<>January!$A$5)*(January!$B$1:$D$1=Financials!B$3)*(January!$B$2:$D$5)) copy across

B5=SUMPRODUCT((January!$A$2:$A$5=January!$A$5)*(January!$B$1:$D$1=Financials!B$3)*(January!$B$2:$D$5)) copy across

B10=SUMPRODUCT((February!$A$2:$A$5<>February!$A$5)*(February!$B$1:$D$1=Financials!B$9)*(February!$B$2:$D$5)) copy across

B11=SUMPRODUCT((February!$A$2:$A$5=February!$A$5)*(February!$B$1:$D$1=Financials!B$9)*(February!$B$2:$D$5)) copy across
 
Upvote 0
Try
Sheet

Finacials

B4=SUMPRODUCT((January!$A$2:$A$5<>January!$A$5)*(January!$B$1:$D$1=Financials!B$3)*(January!$B$2:$D$5)) copy across

B5=SUMPRODUCT((January!$A$2:$A$5=January!$A$5)*(January!$B$1:$D$1=Financials!B$3)*(January!$B$2:$D$5)) copy across

B10=SUMPRODUCT((February!$A$2:$A$5<>February!$A$5)*(February!$B$1:$D$1=Financials!B$9)*(February!$B$2:$D$5)) copy across

B11=SUMPRODUCT((February!$A$2:$A$5=February!$A$5)*(February!$B$1:$D$1=Financials!B$9)*(February!$B$2:$D$5)) copy across

Haha yea that gets to the result but it's cheating. The reason for the mapping is because the real data Im' using have hundreds of GL accounts. You're solution can't handle more than 2 financial statement line items without referring to a map.

I like where your heads at, any chance you can do it using the mapping key?
 
Upvote 0
You can't 'reverse lookup' the map from within a SUMPRODUCT like you want - that's an Access job.
You need a helper column in each sheet to do that with a VLOOKUP/OFFSET or Index/MATCH and a total for the stores in each row, I'd insert a column B and C in front of the data and before the stores so you know it's the same place each month (assuming if you open a new store in June you get a new column)
if you do them you could get away with a SUMIFS for each sheet
The easiest option is the one you identified - put it all into a single tab with a column for the month name and the total and helper column. You can easily slice and dice on that.
 
Upvote 0
You can't 'reverse lookup' the map from within a SUMPRODUCT like you want - that's an Access job.
You need a helper column in each sheet to do that with a VLOOKUP/OFFSET or Index/MATCH and a total for the stores in each row, I'd insert a column B and C in front of the data and before the stores so you know it's the same place each month (assuming if you open a new store in June you get a new column)
if you do them you could get away with a SUMIFS for each sheet
The easiest option is the one you identified - put it all into a single tab with a column for the month name and the total and helper column. You can easily slice and dice on that.

Thanks Johnny! Yea that makes sense. Last night I started messing around with Power Query... really trying to figure this out with as minimal data manipulation as possible since we export tons of GLs all the time.
 
Upvote 0
we export tons of GLs all the time.
Haha me too. Dunno what we did in a previous life to deserve that.

Unless the data gets too big (i.e. there's matches and countifs/Sumifs in it which slows it down too much), I always put it into a single block if I can, it just makes life easier in the long run.

These days I always try and use tables for blocks of data so formulae get copied down automatically. They do corrupt alas if they get too big and you monkey around with individual cells. We're in the process of upgrading to Excel 2016 and I'm looking to using tables and the Data Model to consolidate tables and update linked values without needing a lookup which I've read you can do but am buggered if I can find out how.
 
Upvote 0

Forum statistics

Threads
1,215,444
Messages
6,124,891
Members
449,194
Latest member
JayEggleton

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