Dynamic Reference inside Rank.EQ formula

Nomarch

New Member
Joined
Jul 20, 2011
Messages
4
Hello, this is a bit of a new concept (for me) I'm trying to master here, so any help or pointing in the right direction is appreciated.

I have a series of numbers (anywhere from 100 to 1000 unique numbers in the series) and I need to rank those numbers according to a trailing number of observations.

For example, I'd like to know the rank of the last value in my series, based on the last 250 observations, and then also have the ability switch that formula to rank the last number based on the last 100 observations, or last 500 observations.

Put another way, within the Rank.EQ formula: RANK.EQ(number, ref, [order]), is there a way to dynamically change the 'ref' portion of the formula to accommodate various ranges (rank over 250 observations, 500 observations, etc)?

I've looked into nesting INDIRECT and OFFSET, but couldn't figure out how make it work. I'm pretty green in VBA, but ready to try that out if that's the best way to get this done.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
For example, I'd like to know the rank of the last value in my series, based on the last 250 observations, and then also have the ability switch that formula to rank the last number based on the last 100 observations, or last 500 observations.
Not sure that I have understood your requirement, and don't know your layout, but see if this is any use.
I'm assuming no blank cells within the cells containing numbers.

As shown, this ranks the 2 at the bottom of the list 3rd out of the last 4 cells (green).
If we change cell D1 to 6 then it would rank the 2 at the bottom out of the last 6 cells (green & yellow) & that result would be 5.

Excel Workbook
BCDE
11343
25
35
46
57
64
78
85
99
103
111
125
136
142
15
16
Rank out of last n
 
Last edited:
Upvote 0
Hello Peter, thank you for your response, and for investing the time in answering my question. This definitely got me pointed in the right direction. Cheers!
 
Last edited:
Upvote 0
May I just get a quick explanation of what is going on inside the Lookup formula? I don't understand the 9.99E+307 part of the formula. What is that supposed to exactly?
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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