Help to fully understand this formula

easybpw

Active Member
Joined
Sep 30, 2003
Messages
437
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Everyone, thanks for all the help. I have another question. I have been trying to understand this formula I have been given but I can not understand all the parts.The formula does work wonderfuly. I use it to rank certain cells. Here it is:

=RANK(AC6,$AC$6:$AC$71)+COUNTIF($AC$6:AC6,AC6)-1

I understand the rank portion but....would someone kindly tell me in simple terms what the COUNTIF part does? That is where I get lost. Again I know the formula works as I want it but I don't understand it and a friend of mine is asking me what this part of the formula is for.

Thanks again.

Bill
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi,
Thi first part gives you the rank within the list. However if there are more than one of that specific entrys they will all have the same rank. The second part counts the number of equal entries following in the list. That way all entries will get a unique rank.
 
Upvote 0
Ok I think I understand some. Without the COUNTIF then everyone has the same rank. Right? What does the -1 at the end of the formula do?

Bill
 
Upvote 0
Wthout the -1; If rank is 1 and count is 1 result would be 2; it would rank from 2 and up...
 
Upvote 0
Ok I think I got it, for the most part. Thanks for the help!

Bill
 
Upvote 0
easybpw said:
Ok I think I got it, for the most part. Thanks for the help!

Bill

There is a post of mine out there, which describes RANK in terms of COUNTIF. I couldn't find it myself, maybe you can.
 
Upvote 0
Aladin,

I think I found it, thanks! You have come through for me when needed!

Bill
 
Upvote 0
Hi again. A follow up to this post of mine. Below is a look at a simplified spreadsheet. I did it for this forum. The original is too big.
Book1
ABCDE
1Rank
2blue107
3orange185
4green203
5yellow204
6brown126
7purple261
8pink222
9
10Top55
11purple26
12pink22
13green20
14yellow20
15orange18
Sheet1



What I was wondering is....how can I get the ranking to include the top 5? I mean that is what I asked for but because of the tie (green and yellow tied at 20) it really is only giving me the top 4. I know if I change the 5 to 6 in column E10 that would do it but lets say there isn't a tie in this instance then I would get the top 6 and I only want the top 5. I think the countif function of the formula is determining the ties, right?

Any help is always appreciated!

Bill
 
Upvote 0
easybpw said:
...
What I was wondering is....how can I get the ranking to include the top 5? I mean that is what I asked for but because of the tie (green and yellow tied at 20) it really is only giving me the top 4. I know if I change the 5 to 6 in column E10 that would do it but lets say there isn't a tie in this instance then I would get the top 6 and I only want the top 5. I think the countif function of the formula is determining the ties, right? ...
Top5.xls
ABCDE
1XYRank
2blue107
3orange185
4green203
5yellow204
6brown126
7purple261
8pink222
9
10Top5Y5
11purple26
12pink22
13green20
14yellow20
15orange18
16brown12
17  
18  
Sheet2


Formulas...

D2:

=RANK(B2,$B$2:$B$8)+COUNTIF(B2:$B$2,B2)-1 [ no change ]

A11:

=IF(ROW()-ROW($A$11)+1<=$E$10+COUNT($B$11:B11)-SUMPRODUCT(($B$11:B11<>"")/COUNTIF($B$11:B11,$B$11:B11&"")),INDEX($A$2:$A$8,MATCH(ROW()-ROW($A$11)+1,$D$2:$D$8,0)),"")

Augmented for extending "Top 5" in case of ties in the Top N list.

B11:

=IF(ROW()-ROW($B$11)+1<=$E$10+COUNT($B$10:B10)-(SUMPRODUCT(($B$10:B10<>"")/COUNTIF($B$10:B10,$B$10:B10&""))-1),INDEX($B$2:$B$8,MATCH(ROW()-ROW($B$11)+1,$D$2:$D$8,0)),"")

Augmented for extending "Top 5" in case of ties in the Top N list.
 
Upvote 0
Aladin,

Thanks for the formulas. They seem very complex. I inserted them and things worked ok but when I copied down some data did not work. I do not know why as it worked the other way. Actually Column C copied correctly so I am very confused. Below is a small portion of the worksheet. Can you help me out?

Bill
EFS Football Scores 2003.xls
ABCD
70
71
72LeaderBoard10
73NamesPositionPoints
74TorryHoltWR159
75SimeonRiceDL154
76DavidCarrQB150
77MikeRuckerDL130
78DaunteCulpepperQB127
79RyanLongwellK125
80  123
81  119
82  114
83  114
84  109
85   
86   
87   
88   
89   
90   
LG 16
 
Upvote 0

Forum statistics

Threads
1,215,339
Messages
6,124,373
Members
449,155
Latest member
ravioli44

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