Mutiple sheets average to last sheet using indirect

MichelGagnon

New Member
Joined
Oct 19, 2017
Messages
6
I have multiple sheets all named with a year. I have a last sheet called average.
I have found a way to average all the years into an exact same table on that last sheet.

=AVERAGE('2016:2020'!B4)

Now I am trying to use indirect to get the value of two cells so that I can easily change the years calculated. Now the formula that I have found only averages the first and last year.

=AVERAGE(INDIRECT("'"&M27:M28&"'!"&"B4"))

What am I missing?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I have multiple sheets all named with a year. I have a last sheet called average.
I have found a way to average all the years into an exact same table on that last sheet.

=AVERAGE('2016:2020'!B4)

Now I am trying to use indirect to get the value of two cells so that I can easily change the years calculated. Now the formula that I have found only averages the first and last year.

=AVERAGE(INDIRECT("'"&M23:M24&"'!"&"B4"))

What am I missing?

I thought that it should be this way:

=AVERAGE(INDIRECT("'"&M23&":"&M24&"'!B4"))

But I get an Invalid Cell reference number.
 
Upvote 0
In case it helps anyone, I have found this formula on redit:

=AVERAGE(SUMIF(INDIRECT("'"&ROW(INDIRECT($M$23&":"&$M$24))&"'!B4"),">0"))
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,268
Members
448,558
Latest member
aivin

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