# Moving Range Formula

##### Well-known Member
Anybody have an idea for a formula that calculates moving ranges? For example, Column A contains dates and column B contains data. I need a formula in column C that will calculate the within-day range but only in the last cell for that day. For example, if cells B20:B22 contain data for one day (the dates would be in cells A20:A22), then I want C22 to contain the within-day range.

The number of data points per day will vary from 1 to who knows. Thanks for any help!

### Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Maybe try:

Code:
=IF(A22<>A23,SUMIF(A:A,A22,B:B)/COUNTIF(A:A,A22),"")

which you can copy up and down.

Replies
2
Views
120
Replies
1
Views
100
Replies
2
Views
496
Replies
1
Views
114
Replies
1
Views
56

1,203,467
Messages
6,055,590
Members
444,800
Latest member
KarenTheManager

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