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:
 
Thank you both!

Now, here's a question... how do we write a custom function that allows the user (me :biggrin: ) to enter the following arguments:

1. Array
2. Last (n) number of observations

So, the user would pass the array and the last n number of observations that she/he wanted the SUM of.

How would you do that? Is it very tricky?

Thank you,
Rachel :biggrin: :biggrin:
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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