How to rank numbers sequentially by value

Salgueiro

New Member
Joined
Oct 2, 2018
Messages
4
Hello, new member but longtime reader.
I haven't been able to find a solution for this particular issue, hope there is one.

Given a sheet with several thousand lines, each line representing an item reference code (SS0003, SR0528, etc), I've added a simple countif on each line to determine how many equal reference codes are in the sheet. For example, each "SS0003" reference code has 18 entries, "SR0528" has 17, etc.

What I need to do is rank the numbers from 1 to 10 (I'm trying to build a Top 10 without having to do a pivot table), but using unique values. That is, 18 would be 1 (as it's the largest value), 17 would be 2 (as it's the second largest value), and so on. I've tried the RANK function, but I find that 18 is indeed 1, but the second highest value, 17, is actually ranked 19 (as there are 18 values before it).

Is there a way? I hope I've explained myself properly, and thanks for your help.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Care to post the COUNTIF formula that you have?

Hi,

the COUNTIF is not really very relevant. Something like COUNTIF(A:A;"A2") where the values in column A are the references. So it there are 18 "SS0003" and 17 "SR0528, it ends up like this:

[TABLE="width: 264"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]References[/TD]
[TD]Countif(A:A;A2)[/TD]
[TD]RANK(A2;A:A)[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SS0003[/TD]
[TD]18[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SR0528[/TD]
[TD]17[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]SR0528[/TD]
[TD]17[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]SR0528[/TD]
[TD]17[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]SR0528[/TD]
[TD]17[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]SR0528[/TD]
[TD]17[/TD]
[TD]19[/TD]
[/TR]
</tbody>[/TABLE]

My question is: is there a way for excel to identify 18 as the highest value in column C, therefore 1, and 17 as the
ftLWrz
second highest value in column C, therefore 2 (and not 19)?
 
Upvote 0
In C2 control+shift+enter, not just enter, and copy down:

=MATCH(B2,LARGE(IF(FREQUENCY($B$2:$B$24,$B$2:$B$24),$B$2:$B$24),ROW(INDIRECT("1:"&SUM(IF(FREQUENCY($B$2:$B$24,$B$2:$B$24),1))))),0)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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