Ranking most frequent, problem with ties

cassio

New Member
Joined
Jan 24, 2017
Messages
1
Hi, I'm breaking my head over this, I wonder if any of you could help me out.

I work in a small library and I'm trying to rank our most frequent users. We already have a table with every borrowing of a book, with the name of the user in a column. How many times the user appears is equal to how many books he took.

I was able to count how many times they appear, but since there is both repeated numbers for the same user and also sometimes the users also tie between themselves, I couldn't solve the problem of ranking them properly. I want every user to appear, even if they tie. Here is how the table looks like, simplified, and also what I want to do:

UserBooks taken Ranking I wantUserBooks taken
John31John3
John32Frank2
Frank22Mary2
John33Karen1
Mary23Bruno1
Karen1
Frank2
Mary2
Bruno1

<tbody>
</tbody>


I'd appreciate any tip at this point. Thank you!

PS: I'm using Excel 2010
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Welcome to the forum.

Interesting problem. Fairly easy to define, fairly difficult to solve. Here's one option:

ABCDEF
1UserBooks takenRanking I wantUserBooks taken
2
3John31John9
4John32Frank4
5Frank22Mary4
6John34Karen1
7Mary24Bruno1
8Karen1
9Frank2
10Mary2
11Bruno1

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet9

Worksheet Formulas
CellFormula
D4=IF(F4="","",COUNTIF($F$3:$F3,">"&F4)+1)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
E3{=IF(F3="","",INDEX($A$3:$A$20,MIN(IF((SUMIF($A$3:$A$20,$A$3:$A$20,$B$3:$B$20)=F3)*(COUNTIF(E$2:E2,$A$3:$A$20)=0),ROW($A$3:$A$20)-ROW($A$3)+1))))}
F3{=IFERROR(LARGE(IF($A$3:$A$20<>"",IF(MATCH($A$3:$A$20,$A$3:$A$20,0)=ROW($A$3:$A$20)-ROW($A$3)+1,SUMIF($A$3:$A$20,$A$3:$A$20,$B$3:$B$20))),ROWS(F$3:F3)),"")}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>




Put the F3 formula in. Change the ranges to match your sheet. You can use a large range with empty rows on the end to allow for growth. Confirm with Control+Shift+Enter, and drag down. Repeat with the E2 formula. In D3, put a 1. Then put the non-array formula in E4 and drag down.

Let me know if this works for you.
 
Upvote 0

Forum statistics

Threads
1,216,080
Messages
6,128,692
Members
449,464
Latest member
againofsoul

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