Average for Dynamic Ranges that varies each day (Offset)

roadnut

New Member
Joined
Feb 20, 2013
Messages
4
I get information every day regarding the number of days until the end of something. As shown in the example, on 6/1 in cell A4, there's 1 day until this particular event ends. Cell A5, that particular event ends in 2 days, In cells A6-A8, 3 events end in 4 days, and so forth. So on 6/2, in Column F, that 1st event ended and doesn't show. The event that had 2 days left now has 1 day left; the events with 4 days left now have 3 days left, etc. The events countdown days are grouped via event (example uses really random event names) that need to be kept separated, and new events can appear.

What I'm looking for is a way to dynamically figure out the average of the Days to End for each particular subset (Ham, Chair, Soda, etc) in columns C and G. I can copy and paste the column(s) into the spreadsheet. It needs to look UP from the Total column, and that's where I am having the issue - most examples on the internet refer to rows being added in the middle or at the end. As shown for 6/1 & 6/2, the number of events to average will change daily.

Other info: The Days to End will actually be a formula (Future Date - Today Date). I can use if-then statements as needed, such as in column C: "If Column A doesn't include Total, then the cell is blank. If column A does include total then compute the average for everything above to the next blank cell in column B" (or something to that effect). While Column A and E include "Ham Total", "Chair Total", that's the Subtotal function that is utilized for other columns that I didn't show here.

Let me know if I can provide more info.
 

Attachments

  • Dynamic Days to End.PNG
    Dynamic Days to End.PNG
    39.3 KB · Views: 14

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

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