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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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,215,167
Messages
6,123,401
Members
449,098
Latest member
ArturS75

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