complex summing of multiple worksheets

simonf

Board Regular
Joined
Jun 18, 2002
Messages
207
Book1
ABCDEFG
1Aug-02Sep-02Oct-02Nov-02Total
2Revenue
3Book2,28815,38929,96546,92694,568
4CD4,9004,8145,3775,58020,671
5DVD250238226214927
6Tape6547588688573,137
7
8GrossRevenue8,09221,19836,43653,578119,303
9
10Expenses
11Bankcharges52856387287
12ConsultingFees4,0007,5208,7409,16829,428
13Depreciation6442257928976
14GeneralOffice5465119
15Professionalfees478555856571,775
16
17TotalExpenses5,1748,4398,96710,00432,584
18
19NetIncome2,91812,75927,46843,57386,719
20
Happy



Hi, I have multiple worksheets each containing a financial statement like the above. Each worksheet has a different company name. Each worksheet's type of revenue and expenses could be different.

I need to combine all of them into a worksheet of predetermined format, thus pivot table is not a consideration. All the worksheets and the summary worksheet is in the same workbook.

In the summary worksheet, I have a check box to select which company I want to be included in the summary. So everytime I check a company, the name would appear in A1:A10. The way the formula is setup now is a multiple IF statements hard coded in each cell. ie. IF A1=HAPPY,HAPPY!D14,0)+IF(A2=SAD,SAD!D14,0+IF(A3=MAD,MAD!D14,0)+IF(A4=JOY,JOY!D14,0)

So the more companies I have, the more IF I have to add-on. Now, I can use the INDEX(MATCH()) to grab the info I need from each company to the summary worksheet.

The problem is how to sum each number according to which companies are selected.

I hope I'm explaining it clearly. Is there a formula or VBA procedure to look at a range of worksheet names and sum a particular cells from the different worksheets?
 
On 2002-10-25 19:42, simonf wrote:
Guess not since a few people will be using this file but if I could use a, which one will you recommend? Thanks.

The morefunc.xll add-in, a free download from:

http://longre.free.fr/index.html

What for? To satisfy your boss...
aaSelectiveConsolidation SimonF.xls
ABCDE
1co.11
2014
3co.31
40
50
60
70
80
90
100
Summary


A1:A10 is set up with data validation (I believe you have something different, but that doesn't matter much).

This is important: B1:B10 has the following formula:

=(LEN(A1)>0)+0

The consolidation formula is in D2...

=SUMPRODUCT((THREED(co.1:co.10!B1))*(B1:B10))

co.1!B1 is 4

co.3!B1 is 10.

The others have also values, but, as you see, the formula sums just these two as intended.

Aladin
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hummm, interesting add-ins but I guess it won't work if the company names are random non-series such as: apple, orange, banana, grape etc. Any other help will be much appreciated.
 
Upvote 0
To simonf

What happened when you tested the suggestion?

----

One can consider

Co. Include
ABC Y 1
BCC N 0
CCC N 0
DDD Y 1
EEE Y 1
FFF N 0

Evaluate include range with a formula such as

=(B19="Y")+0

Revise the range for the consolidation formula as necessary.

Dave
This message was edited by dave patton on 2002-10-26 00:41
 
Upvote 0
Book1
ABCD
1apple1
2ban143
30
4space1
50
6cow1
summary


Hey, it works perfectly. I have data in B1 of sheets named:apple, ban, tile, space, dog, cat. And it summed perfectly.

Now, I just have to figure out how to incoporate INDEX(MATCH()) into the formula to return the correct cell value such as B1.

And most importantly, to see if I can use this add-in at all! If not, am I really screwed?
 
Upvote 0
Ok, once I get the position of the cell I want using INDEX(MATCH()), how do I translate that row & col back to a cell reference to be used in the THREED formula?

eg. INDEX(B5:Z29, 5, 9) What function can translate this to J9? Thanks.
 
Upvote 0
On 2002-10-29 13:57, simonf wrote:
Ok, once I get the position of the cell I want using INDEX(MATCH()), how do I translate that row & col back to a cell reference to be used in the THREED formula?

eg. INDEX(B5:Z29, 5, 9) What function can translate this to J9? Thanks.

Simon,

Glad to hear you succeded in applying the selective consolidation scheme I described.

That said, I don't think I understand the INDEX/MATCH bit. I thought you knew beforehand which cell9S0 from the selected worksheets will be consolidated.

Aladin
This message was edited by aladin akyurek on 2002-10-29 16:06
 
Upvote 0
It's not so elegant, but...

=ADDRESS(ROW(INDEX(B5:Z29,5,9)),COLUMN(INDEX(B5:Z29,4,9)),4)

will give you J9
 
Upvote 0
Thanks but the INDEX will only return one value instead of the 2 you suggested. As for the known value, I could use that and copy across and down but I want to make it even more flexible incase I have to make changes and that's where the INDEX/MATCH comes in. In that scheme, the INDEX/MATCH will only return one value but the row/col reference is only refering to the INDEX range and not the global position within the entire worksheet.
 
Upvote 0
On 2002-10-29 14:58, simonf wrote:
Thanks but the INDEX will only return one value instead of the 2 you suggested. As for the known value, I could use that and copy across and down but I want to make it even more flexible incase I have to make changes and that's where the INDEX/MATCH comes in. In that scheme, the INDEX/MATCH will only return one value but the row/col reference is only refering to the INDEX range and not the global position within the entire worksheet.

What kind of info/data do you have in B5:Z29?
 
Upvote 0

Forum statistics

Threads
1,216,171
Messages
6,129,287
Members
449,498
Latest member
Lee_ray

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