Ranking tiebreak problem

Mtyler

Board Regular
Joined
Oct 13, 2006
Messages
62
All

I'm trying to rank data in largest to smallest order, with a tiebreak for identical items. The tiebreak sorts by size based on a second variable.

I'm using this formula:

=RANK($BP8,$BP$8:$BP$360,0)+SUMPRODUCT(--($BP$8:$BP$360=$BP8),--($K$8:$K$360>$K8))

This has worked brilliantly, but I've recently come across a problem where I have items ranked the same. It seems to derive from the two parts of the formula.

ie I have 5 items with $6m, which are ranked as 52 (using rank formula), and the tiebreak adds on anything from 0 to 5 (using the sumproduct part). However, I also have multiple items as $5.5m, which are ranked as 51, and add on another item (from the sumproduct amount).

This leads to items with the same ranking (ie 52+3 and 51+4). Any thoughts on how to fix for this? Using Excel 2003.

Thanks in advance
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Have the tiebreaker value be a deceimal value instaed of a whole number. Then the tiebreaker value will be small enough to break the tie but not large enough to change a rank.

=RANK($BP8,$BP$8:$BP$360,0)+(SUMPRODUCT(--($BP$8:$BP$360=$BP8),--($K$8:$K$360>$K8))/100)
 
Upvote 0
Have the tiebreaker value be a deceimal value instaed of a whole number. Then the tiebreaker value will be small enough to break the tie but not large enough to change a rank.

=RANK($BP8,$BP$8:$BP$360,0)+(SUMPRODUCT(--($BP$8:$BP$360=$BP8),--($K$8:$K$360>$K8))/100)

Thanks - I had considered that but wondered whether the rank formula only worked on whole numbers or not - will check.

Thanks
 
Upvote 0
Have the tiebreaker value be a deceimal value instaed of a whole number. Then the tiebreaker value will be small enough to break the tie but not large enough to change a rank.

=RANK($BP8,$BP$8:$BP$360,0)+(SUMPRODUCT(--($BP$8:$BP$360=$BP8),--($K$8:$K$360>$K8))/100)

Have just realised that I am reliant on the tiebreak being an integer as I pull through information based on the rank.

Is there another solution to this?

Thanks

Matt
 
Upvote 0
<br /><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="font-weight: bold;text-align: center;;">Score</td><td style="font-weight: bold;text-align: center;;">Rank</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: center;;">88</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;background-color: #FFFF99;;">55</td><td style="text-align: center;background-color: #FFFF99;;">4</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;background-color: #CCFFFF;;">44</td><td style="text-align: center;background-color: #CCFFFF;;">7</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;background-color: #CCFFCC;;">77</td><td style="text-align: center;background-color: #CCFFCC;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;background-color: #CCFFCC;;">77</td><td style="text-align: center;background-color: #CCFFCC;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;background-color: #FFFF99;;">55</td><td style="text-align: center;background-color: #FFFF99;;">5</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;background-color: #CCFFFF;;">44</td><td style="text-align: center;background-color: #CCFFFF;;">8</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: center;background-color: #FFFF99;;">55</td><td style="text-align: center;background-color: #FFFF99;;">6</td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: center;;">11</td><td style="text-align: center;;">9</td></tr></tbody></table><br /><br /><table cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B2</th><td style="text-align:left">=RANK(<font color="Blue">A2,$A$2:$A$10</font>)+COUNTIF(<font color="Blue">$A$2:A2,A2</font>)-1</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
<br /><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="font-weight: bold;text-align: center;;">Score</td><td style="font-weight: bold;text-align: center;;">Rank</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: center;;">88</td><td style="text-align: center;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;background-color: #FFFF99;;">55</td><td style="text-align: center;background-color: #FFFF99;;">4</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;background-color: #CCFFFF;;">44</td><td style="text-align: center;background-color: #CCFFFF;;">7</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;background-color: #CCFFCC;;">77</td><td style="text-align: center;background-color: #CCFFCC;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;background-color: #CCFFCC;;">77</td><td style="text-align: center;background-color: #CCFFCC;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;background-color: #FFFF99;;">55</td><td style="text-align: center;background-color: #FFFF99;;">5</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;background-color: #CCFFFF;;">44</td><td style="text-align: center;background-color: #CCFFFF;;">8</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: center;background-color: #FFFF99;;">55</td><td style="text-align: center;background-color: #FFFF99;;">6</td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: center;;">11</td><td style="text-align: center;;">9</td></tr></tbody></table><br /><br /><table cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B2</th><td style="text-align:left">=RANK(<font color="Blue">A2,$A$2:$A$10</font>)+COUNTIF(<font color="Blue">$A$2:A2,A2</font>)-1</td></tr></tbody></table></td></tr></table><br />

Alpha - thanks for this, although it doesn't allow for a tiebreak based upon a second condition (merely it ranks ties based on their position in the list).
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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