Ranking Issue

mohamed ali abdelgawad

Board Regular
Joined
Nov 18, 2016
Messages
71
Office Version
  1. 365
Platform
  1. Windows
Hi Dears

i use this formula to get unique rank

Code:
=IFERROR((COUNTIF(F5:F$426,F5)-1)+RANK(F5,F$6:F$426),"")

Screenshot_2017-07-10_19.13.16.png


But some times i didn't get some number
like you see here . no 10 rank

Screenshot_2017-07-10_19.13.25.png



so ho to avoid this issue
example sheet

Thank
 
Post a small sample of how you want your output look like.

Ok
If i use rank only this will be result , as you see below rank 17 , 10 , 2, 15 and 4 all of this ranks duplicate
%Rank
Sales 24100%26
Sales 2584%46
Sales 26105%17
Sales 27115%10
Sales 28130%2
Sales 2997%31
Sales 30105%17
Sales 9090%43
Sales 9193%37
Sales 9296%32
Sales 93101%24
Sales 94110%14
Sales 9559%49
Sales 96105%17
Sales 118115%10
Sales 11990%42
Sales 12096%34
Sales 12193%39
Sales 12293%38
Sales 123139%1
Sales 184100%28
Sales 18597%30
Sales 18689%44
Sales 18740%50
Sales 188105%17
Sales 242119%8
Sales 24379%48
Sales 244101%25
Sales 24598%29
Sales 246109%15
Sales 24791%41
Sales 24896%35
Sales 24981%47
Sales 25096%33
Sales 251114%13
Sales 320104%23
Sales 321105%17
Sales 322120%7
Sales 323125%4
Sales 324105%17
Sales 32596%36
Sales 326124%6
Sales 32785%45
Sales 328115%10
Sales 329109%15
Sales 330125%4
Sales 33191%40
Sales 338100%27
Sales 340115%9
Sales 341130%2

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>


if use rank + count if
it gives me unique rank as you see below
But there's some numbers missing like #9

%Rank
Sales 24100%26
Sales 2584%46
Sales 26105%17
Sales 27115%10
Sales 28130%2
Sales 2997%31
Sales 30105%18
Sales 9090%43
Sales 9193%37
Sales 9296%32
Sales 93101%24
Sales 94110%14
Sales 9559%49
Sales 96105%19
Sales 118115%11
Sales 11990%42
Sales 12096%34
Sales 12193%39
Sales 12293%38
Sales 123139%1
Sales 184100%28
Sales 18597%30
Sales 18689%44
Sales 18740%50
Sales 188105%20
Sales 242119%8
Sales 24379%48
Sales 244101%25
Sales 24598%29
Sales 246109%15
Sales 24791%41
Sales 24896%35
Sales 24981%47
Sales 25096%33
Sales 251114%13
Sales 320104%23
Sales 321105%21
Sales 322120%7
Sales 323125%4
Sales 324105%22
Sales 32596%36
Sales 326124%6
Sales 32785%45
Sales 328115%12
Sales 329109%16
Sales 330125%5
Sales 33191%40
Sales 338100%27
Sales 340115%12
Sales 341130%3



<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>


you can download example sheet ant try it
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I ran Mohamed's sheet past the Excel MVP group and it is a very intriguing situation.

It is generally well known that Excel only had 15 digits of precision. That is why you find so many people complaining that they can not store their 16-digit credit card numbers in Excel without losing the last digit.

Some of my friends cracked open the XML of Mohamed's worksheet and discovered that Excel is actually storing seventeen digits :eek:. It turns out that Mohamed has four cells that appear in Excel as 115%.
But in the XML, those four cells are actually:
0.11499999999999999
0.11499999999999999
0.11499999999999999
0.11500000000000000

The maddening thing here is that Excel won't show more than 15 digits, so we can never see in the Excel user interface nor in VBA that the cell contains anything other than 115%.

COUNTIFS and =A2=A3 all treat all four of those cells as if they contain 115%.

But we can tell from how the RANK function and the Sort feature work that Excel is using the 16th and 17th digits. This causes problems.

Mohamed - your workaround is that when you calculate the percentage, you need to wrap that calculation in a rounding function to keep only 14 or 15 digits. =ROUND(A2/B2,15) will prevent this from happening again.

I am guessing this won't make you happy. But the fact is that it will solve your problem. The other solution would be to push Microsoft to make RANK and sorting less accurate, but that will slow Excel calculation down for 749,999,999 other people, and I am not going to advocate for less accuracy and slower Excel.
 
Upvote 0
I ran Mohamed's sheet past the Excel MVP group and it is a very intriguing situation.

It is generally well known that Excel only had 15 digits of precision. That is why you find so many people complaining that they can not store their 16-digit credit card numbers in Excel without losing the last digit.

Some of my friends cracked open the XML of Mohamed's worksheet and discovered that Excel is actually storing seventeen digits :eek:. It turns out that Mohamed has four cells that appear in Excel as 115%.
But in the XML, those four cells are actually:
0.11499999999999999
0.11499999999999999
0.11499999999999999
0.11500000000000000

The maddening thing here is that Excel won't show more than 15 digits, so we can never see in the Excel user interface nor in VBA that the cell contains anything other than 115%.

COUNTIFS and =A2=A3 all treat all four of those cells as if they contain 115%.

But we can tell from how the RANK function and the Sort feature work that Excel is using the 16th and 17th digits. This causes problems.

Mohamed - your workaround is that when you calculate the percentage, you need to wrap that calculation in a rounding function to keep only 14 or 15 digits. =ROUND(A2/B2,15) will prevent this from happening again.

I am guessing this won't make you happy. But the fact is that it will solve your problem. The other solution would be to push Microsoft to make RANK and sorting less accurate, but that will slow Excel calculation down for 749,999,999 other people, and I am not going to advocate for less accuracy and slower Excel.
Thanks MR Excel For your caring on my case
I'll use round to get rank as a facade

thanks for everyone reply to me
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,210
Members
448,874
Latest member
b1step2far

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