Issue with Duplicate RANK. If duplicate, choose lowest RANK last period

jacc99

New Member
Joined
Jun 14, 2021
Messages
12
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. MacOS
Hi there,
So i have a bunch of stock price returns that i am ranking relative to one another. I am then trying to assign weights based on the highest 2 and lowest 2. These should sum to net 0. However, i occasionally have two stocks with 0% returns. This causes an issue whereby RANK obviously ranks these equally, however this causes the net to be -0.5, -1 or else etc.
I am wondering if there is any way i can formulate the function whereby if two or more cells have the same return and thus ranked the same, it will select the stock with the lowest rank last period out of said stocks. i.e. if stock A B C have rank 2 2 2 respectively this period, but 1 3 5 last period, it will assign the 0.5 weight to stock A as it had the lowest RANK last period (1).

I have added a cut out so you can see where my issue lies. As can be seen, AM, AN, AO have the same rank in the second period, and thus they have been assigned the same weight of 0.5 in AU, AV, AW. I need it to assign the 0.5 weight to AM only out of those three, as its rank last period was the lowest at rank 1.

Many thanks

2019 Lookback returns data.xlsm
AHAIAJAKALAMANAOAPAQARASATAUAVAW
139589RankWeights
13959067835142 -0.5-0.5  0.5 0.5
13959157861222 -0.5-0.5 0.50.50.50.5
Cross Sectional Ranks
Cell Formulas
RangeFormula
AH139590:AO139591AH139590=IFERROR(RANK('Lookback Data'!AH139590,'Lookback Data'!$AH139590:$AO139590,0),"")
AP139590:AW139591AP139590=IFERROR(IFS(AH139590=SMALL($AH139590:$AO139590,2),0.5,AH139590=SMALL($AH139590:$AO139590,1),0.5,AH139590=LARGE($AH139590:$AO139590,2),-0.5,AH139590=LARGE($AH139590:$AO139590,1),-0.5),"")
 
Last edited:

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,214,583
Messages
6,120,377
Members
448,955
Latest member
BatCoder

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