average formula, need it to change depending on number of years

Badnames

Board Regular
Joined
Jun 12, 2007
Messages
211
I have three years with a different value, year 1-3 are in cells R14-T14.

The values for years 1-3 are 20, 12, 6.

From a dropdown in C9 I'm selecting the number of months 12,24,36.

In cell p14, i want to have an average formula, that averages up to all three years depending on what I choose from the drop down.

So for 3 years, I'd get 12.6677777, for 2 16, and 1 20.

I initially thought an average with indirect, such as:

=average(r14:indirect("rc[2+($c$9/12)]",0)

I've been unlucky using an indirect though. Any thoughts on how I can have the formula shift depending on the years? I really don't want to use a long if.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,224,509
Messages
6,179,194
Members
452,893
Latest member
denay

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