#### rca

##### Board Regular
Hello!

I have a dynamic named range (called "myRange") that is currently in cells C3:C45. Each day, this range 'grows' by 1 row. So, tomorrow, for instance, the range will be from C3:C46. I am trying to write a formula that would SUM up the last 5 values in this range. So, simplistically, the formula would just be =SUM(C41:C45). BUT, how do I write a SUM formula that also grows with the range. So, a few weeks from now, the formula would maybe read =SUM(C92:C96).

Is there a way to make the formula 'move' automatically as the range grows with time?

Thanks a lot!
Rachel

### Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

deleted

#### rca

##### Board Regular
Hi Norie,

I don't know how to do that. The current formula is:

=OFFSET(Historical!\$D\$3,0,0,COUNT(Historical!\$D:\$D),1)

#### Norie

deleted

##### MrExcel MVP
rca said:
Hi Norie,

I don't know how to do that. The current formula is:

=OFFSET(Historical!\$D\$3,0,0,COUNT(Historical!\$D:\$D),1)

Are you on Excel 2003?

#### rca

##### Board Regular

Yes, I am on Excel 2003.

Rachel

#### rca

##### Board Regular
Hi Norie,

That formula does not seem to work for me. It returns the last number in the range. I don't think it sums the last 5 numbers in the range.

Any other ideas?

Thanks,
Rachel

#### PA HS Teacher

##### Well-known Member

=SUM(INDEX(C:C,MATCH(9.9E307,F:F)):INDEX(C:C,MATCH(9.9E307,C:C)-4))

#### Norie

deleted

##### MrExcel MVP
rca said:

Yes, I am on Excel 2003.

Rachel

That's just great. This version's list functionality allows you to largely avoid naming ranges by means of dynamic formulas like the one with OFFSET you posted.

Instead of "MyRange" with the definition:

=OFFSET(Historical!\$D\$3,0,0,COUNT(Historical!\$D:\$D),1)

put a label in D2 on Historical, select the current range in D from D2 on, activate Data|List|Create List. Formulas which refer to this list range will be automatically updated whenever the list expands or crimps.

Suppose the current range is D3:D60. After you turned D2:D60 into a list, try:

A2:

=MATCH(9.99999999999999E+307,Historical!D3:D60)

B2:

=SUM(INDEX(Historical!D3:D60,A1-MIN(5,A1)+1):INDEX(Historical!D3:D60,A1))

Replies
9
Views
573
Replies
13
Views
130
Replies
11
Views
561
Replies
2
Views
180
Replies
11
Views
475

1,196,013
Messages
6,012,857
Members
441,735
Latest member
melastro

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