# Average for Dynamic Ranges that varies each day (Offset)

##### New Member
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.

#### Attachments

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

### Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Replies
1
Views
273
Replies
3
Views
381
Replies
7
Views
178
Replies
2
Views
80
Replies
1
Views
340

1,126,981
Messages
5,621,952
Members
415,869
Latest member
LWSkinner

### 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.

### Which adblocker are you using?

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

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