INDIRECT SUM WITH SHEET NAMES

occy

New Member
Joined
Jul 15, 2003
Messages
13
I am trying to sum a particular cell across a range of worksheets. My formula is:

=SUM(INDIRECT(K4&":"&K5&"!"&"J60"))

Where K4 contains the name of the first worksheet and K5 contains the name of the last worksheet in the range I want to sum. J60 is the cell I want to sum.

I get the dreaded #ref! result. Help would be much appreciated.

Thanks
 
It may be that the values in cells G12 and H12 don't exactly match the sheet names that you want to pick values from? Other than that I don't have any ideas sorry.

the value in cell G12 is 1 in H12 it is 5. I have sheets labeled from 1-31 exactly how it is in cell g12 and h12.
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I have figured out why it isnt working. The values in cell g12 and h12 represent dates. I reformatted the cells to just have the number 1 if it was for example 06/01/2015 and 5 if it really was 06/05/2015. Since these cells represent dates and not the actual label of the worksheets is there a way to fix this? thanks in advance for any help/
 
Upvote 0
Try...

=SUM(IF((MATCH(Sheets,Sheets,0)>=$C$3)*(MATCH(Sheets,Sheets,0)<=$C$4),SUBTOTAL(9,INDIRECT("'"&Sheets&"'!"&$B$5))))

i am checking on this formula, i tried replacing subtotal 9 into subtotal 101 for the average but still computing the total is there a way i can compute the average amount?
 
Upvote 0
change the sum to average, by the way i am trying to use the formula and making the sum value to dynamic as:

AVERAGE(IF((MATCH(Sheets,Sheets,0)>=$C$3)*(MATCH(Sheets,Sheets,0)<=$C$4),SUBTOTAL(101,INDIRECT("'"&Sheets&"'!"&COLUMN()&ROW()))))

can you help me on this?
 
Upvote 0
change the sum to average,


Right.

by the way i am trying to use the formula and making the sum value to dynamic as:

AVERAGE(IF((MATCH(Sheets,Sheets,0)>=$C$3)*(MATCH(Sheets,Sheets,0)<=$C$4),SUBTOTAL(101,INDIRECT("'"&Sheets&"'!"&COLUMN()&ROW()))))

can you help me on this?

You want to be able to copy down the formula, right?

Try something like...Control+shift+enter:

=AVERAGE(IF((MATCH(Sheets,Sheets,0)>=$C$3)*(MATCH(Sheets,Sheets,0)<=$C$4),SUBTOTAL(1,INDIRECT("'"&Sheets&"'!"&CELL("address",B5)))))
 
Upvote 0
Right.



You want to be able to copy down the formula, right?

Try something like...Control+shift+enter:

=AVERAGE(IF((MATCH(Sheets,Sheets,0)>=$C$3)*(MATCH(Sheets,Sheets,0)<=$C$4),SUBTOTAL(1,INDIRECT("'"&Sheets&"'!"&CELL("address",B5)))))

not necessarily, i want to sum up or average the same cell where the formula sits, if my formula is on c5 it will compute all amount in c5 in various sheets
 
Upvote 0
not necessarily, i want to sum up or average the same cell where the formula sits, if my formula is on c5 it will compute all amount in c5 in various sheets

What do you want then since

{=AVERAGE(IF((MATCH(Sheets,Sheets,0)>=$C$3)*(MATCH(Sheets,Sheets,0)<=$C$4),SUBTOTAL(1,INDIRECT("'"&Sheets&"'!C5"))))}

apparently does not suffice?
 
Upvote 0

Forum statistics

Threads
1,224,832
Messages
6,181,231
Members
453,026
Latest member
cknader

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