formula to scan a list and get last 5 values? please help

rca

Board Regular
Joined
Mar 1, 2005
Messages
182
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 :biggrin: :biggrin:
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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)

Thanks for your help!
 
Upvote 0
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
 
Upvote 0
rca said:
Hello Aladin,

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))
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,558
Latest member
aivin

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