Need formula to calculate automatically most recent avg with new values

raven_ramon

New Member
Joined
Jan 5, 2011
Messages
11
Hello Everyone,
I need some help pls:

I have a tab with 52 colunms for each week of the year, followed by column for most recent 8 weeks avg.

Right now after updating each weekly column with new data, i have to manually change the avg function to the most recent 8 columns.

Is there anyway to make the formula automatically pick up most recent weeks?

Thank you for your help.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
If your data goes from b2:ba2, you can use this formula

This formula goes in cell BB2

=AVERAGE(OFFSET(B2,,IF(ISERROR(MATCH(9.999999E+306,Sheet1!B2:BA2)),MATCH("*",Sheet1!B2:BA2,-1),IF(ISERROR(MATCH("*",Sheet1!B2:BA2,-1)),MATCH(9.999999E+306,Sheet1!B2:BA2),MAX(MATCH(9.999999E+306,Sheet1!B2:BA2),MATCH("*",Sheet1!B2:BA2,-1))))-1,1,-8))
Looks for the last value a2:az2 and then backs up 8 cells for the reference range.


Steve=True
www.exceldashboardtemplates.com
 
Upvote 0
Hello Everyone,
I need some help pls:

I have a tab with 52 colunms for each week of the year, followed by column for most recent 8 weeks avg.

Right now after updating each weekly column with new data, i have to manually change the avg function to the most recent 8 columns.

Is there anyway to make the formula automatically pick up most recent weeks?

Thank you for your help.
Sounds like you want the average of the last 8 entries in the row?

What if there aren't 8 entries?

Where is this data located?
 
Upvote 0
Thank you Steve for the speedy reply.
It seems to be working great on the first row :)
But not when copied down - any reason why?
My data is located in cell ranges H2..BH18 and the avg column for the past 8 wks starts in G2 downwards.
Also, can you just briefly explain to me what are the 9.99999E +306 are doing in the formula?
Thank you so much.
 
Last edited:
Upvote 0
i think i know why it seems not work:
some of the future values i..e wks 34-52 are linked to another cells and now show up as zeros, so your formula takes into account furture values of zeros into account in the formula :)
Any way to circumvent this?
Thanks for the pdf - i understand now the 9.9999E+306.:)
 
Upvote 0
Never mind :) i made the future values an if statement:
if future value = 0,"",future value
and that seems to do the trick.
Thank you!!!!!! :)
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

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