Creating Top 5 List With Multiple Criteria

joeyjoejoejnr

New Member
Joined
Jun 9, 2016
Messages
10
Hello Awesome Excel People!

I'm in the process of creating spreadsheets for a junior football league.
I'm looking to create top 5 lists for each team after each round of the comp.
PS - there are likely to be duplicate scores.

So here is a sample of my data:
First nameSurnameDivisionTeamGame #1Game #2Games
-->
JimJones1Hawks152
DaveDobbs4Hawks021
RegGrundy2Falcons112
RexBrown1Ducks334
BrandonVera3Wildcats53
TylerChai2Falcons40
GregRoberts2Ducks61
QuinSmith1Hawks214
FredBloggs3Ducks1211
JamesJohnson2Ducks127
VincentQuill3Falcons236

<tbody>
</tbody>

So there is going to be about 400 participants across the teams in 4 divisions.
I have defined names of the data for simplicity:
first names (columnA) = FirstName
surnames (columnB) = Surname
division (columnC) = Division
Team (ColumnD) = Team
game #1 (columnE) = game1
game #2 (columnF) = game2
etc.

On other sheets I have a page for each club/team.
I am looking to list the top 5 scorers of each round regardless of division.
I'm looking to add only data in the above sample sheet and have results input automatically.

So for example, the ducks I want to return the following data in a sheet:

Ducks - Game #1 Results
1st2nd3rd4th5th
First nameRexFredJamesGreg
SurnameBrownBloggsJohnsonRoberts
Points3312126
Division1322

<tbody>
</tbody>

I am open to changing the format of the output table if it will make it possible to do this.

Am I dreaming? or can this be done?

Thank you all!
Joe :)
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Try this for results starting in sheet2.
NB:- See Code remarks for more Games
Code:
[COLOR="Navy"]Sub[/COLOR] MG12Jun08
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range, n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Lg [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] col [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] nn [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] K [COLOR="Navy"]As[/COLOR] Variant, c [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] R [COLOR="Navy"]As[/COLOR] Range, Ac [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Str [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Dic [COLOR="Navy"]As[/COLOR] Object
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("D2"), Range("D" & Rows.Count).End(xlUp))
[COLOR="Navy"]With[/COLOR] CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
    [COLOR="Navy"]If[/COLOR] Not .exists(Dn.Value) [COLOR="Navy"]Then[/COLOR]
        .Add Dn.Value, Dn
    [COLOR="Navy"]Else[/COLOR]
        [COLOR="Navy"]Set[/COLOR] .Item(Dn.Value) = Union(.Item(Dn.Value), Dn)
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR]

c = 1
For Ac = 5 To 6 '[COLOR="Green"][B] Nb:- Increase this count to the columns Number you have Games in.[/B][/COLOR]
'[COLOR="Green"][B]At the moment it refers to columns "5 & 6"[/B][/COLOR]
col = col + 1
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] K [COLOR="Navy"]In[/COLOR] .keys
[COLOR="Navy"]Set[/COLOR] Dic = CreateObject("scripting.dictionary")
Dic.CompareMode = vbTextCompare
ReDim Ray(1 To 6, 1 To 6)
Ray(1, 1) = K & " :- Game# " & col & "  Results"
Ray(2, 2) = "First  ": Ray(2, 3) = "Second  ": Ray(2, 4) = "Third   ": Ray(2, 5) = "Forth   ": Ray(2, 6) = "Fifth   "
Ray(3, 1) = "First Name"
Ray(4, 1) = "Surname"
Ray(5, 1) = "Points"
Ray(6, 1) = "Division"
nn = 1
[COLOR="Navy"]For[/COLOR] n = 1 To .Item(K).Count
Lg = Application.Large(.Item(K).Offset(, Ac - 4), n)
    
    [COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] .Item(K).Offset(, Ac - 4)
        [COLOR="Navy"]If[/COLOR] Dn = Lg [COLOR="Navy"]Then[/COLOR]
            [COLOR="Navy"]Set[/COLOR] R = Dn
            [COLOR="Navy"]If[/COLOR] Not Dic.exists(R.Offset(, -2 - col).Value) [COLOR="Navy"]Then[/COLOR]
                    Dic.Add R.Offset(, -2 - col).Value, ""
                    nn = nn + 1
                    Ray(3, nn) = R.Offset(, -3 - col)
                    Ray(4, nn) = R.Offset(, -2 - col)
                    Ray(5, nn) = R.Value
                    Ray(6, nn) = R.Offset(, -1 - col)
            [COLOR="Navy"]End[/COLOR] If
        [COLOR="Navy"]End[/COLOR] If
    [COLOR="Navy"]Next[/COLOR] Dn
[COLOR="Navy"]Next[/COLOR] n
[COLOR="Navy"]With[/COLOR] Sheets("Sheet20").Cells(c, "A").Resize(6, 6)
    .Value = Ray
    .Borders.Weight = 2
    .Columns.AutoFit
    c = c + 7
[COLOR="Navy"]End[/COLOR] With
[COLOR="Navy"]Next[/COLOR] K
[COLOR="Navy"]Next[/COLOR] Ac
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Just an Update:- You will need to change this line at bottom of code from "Sheet20" to "sheet2" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Code:
With Sheets("Sheet20").Cells(c, "A").Resize(6, 6)
to This:-
With Sheets("Sheet2").Cells(c, "A").Resize(6, 6)
 
Upvote 0
Hello Mick G,

Thanks for your speedy response.
I've tried executing the VBA code you have input into the response.

I'm having issues getting it to run. I keep getting errors and it asks me to debug the code.
 
Upvote 0
Is there a way this can be done with excel formulas rather than VB code?
I attempted to replicate your data sample but still had coding errors.
 
Upvote 0

Forum statistics

Threads
1,214,804
Messages
6,121,652
Members
449,045
Latest member
Marcus05

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