+ Reply to Thread
Results 1 to 5 of 5

Rank by 4 columns of numbers and text

  1. #1
    Registered User
    Join Date
    04-15-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question Rank by 4 columns of numbers and text

    I need help with my local football team database to display the ever changing football league table. An example of the table is as follows:

    TEAM PLAYED WON DRAW LOST SCORED CONCEDED DIFFERENCE POINTS
    D 6 4 2 0 12 3 9 14
    C 6 3 2 1 10 5 5 11
    B 6 3 2 1 10 5 5 11
    A 6 3 1 2 11 13 -2 10


    I need a formula that sorts the table by "POINTS", "DIFFERENCE", "SCORED", "TEAM"

    The cells used are CB3:CJ23 and I have this formula so far which creates a RANK in cells CA4:CA23.

    =RANK(CJ4,$CJ$4:$CJ$23,0)+IF(COUNTIF($CJ$4:$CJ$23,CJ4)>1,MATCH(CI4,LARGE(IF($CJ$4:$CJ$23=CJ4,$CI$4:$CI$23),ROW(INDIRECT("1:"&COUNTIF($CJ$4:$CJ$23,CJ4)))),0)-1)+IF(COUNTIF($CI$4:$CI$23,CI4)>1,MATCH(CG4,LARGE(IF($CI$4:$CI$23=CI4,$CG$4:$CG$23),ROW(INDIRECT("1:"&COUNTIF($CI$4:$CI$23,CI4)))),0)-1)

    I just need it finishing to do a final sort on the "TEAM" column so that it is in alphabetical order. I have spent several days on this now looking on google and trying different things. Just to confirm, I will be using VLOOKUP function in cells AS4:BA23 to display the football league table based on the RANK value.

    Any help would be much appreciated.

  2. #2
    Registered User
    Join Date
    04-15-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Rank by 4 columns of numbers and text

    I've found a solution but not the way I really wanted...

    I have number each team from 1 to 20 in alphabetical order in a new "ID" column.
    And because the 3rd part of the formula above sorts the "Goals Scored" column I have added to the formula in these cells. So for example goals scored is now

    =SUM(E4,G4,I4,K4,M4,O4,Q4,S4,U4,W4,Y4,AA4,AC4,AE4,AG4,AI4,AK4,AM4,AO4,D6,D8,D10,D12,D14,D16,D18,D20,D22,D24,D26,D28,D30,D32,D34,D36,D38,D40,D42)+(CA4/10000)

    With the +(CA4/10000) giving each team a unique number to help sort the RANK into alphabetical order. So in the above example Team B and Team C have the same points, goal difference and goals scored. But the new part of the formula means Team B has scored 10.0002 goals and Team C has scored 10.0003 goals. Therefore sorting the teams alphabetically.

    A formula that would be simpler would be more ideal if anyone could work it out.

    Thanks in advance.

  3. #3
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Rank by 4 columns of numbers and text

    A sample workbook is probably needed in order to assist.
    Why would you not at least replace the formula you have with
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please click the * icon below if I have helped.

  4. #4
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Rank by 4 columns of numbers and text

    Hi

    Welcome to the forum!

    Formula =J2+I2/10^3+G2/10^6+(21-ROW(B1))/10^9
    See the ROW? If say 10 teams? Change 11-ROW, 8 teams change 9-ROW and 12 teams 13-ROW.
    You say got 20 teams = this 20 teams 21-ROW.
    This will sort alphabetically order.

    Please see the file.
    Attached Files Attached Files
    To help you by my post? it would be nice to click on to say "Thank you".
    If you are happy with a solution to your problem?
    Click Thread Tools above your first post,
    select "Mark your thread as Solved".

  5. #5
    Registered User
    Join Date
    04-15-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Rank by 4 columns of numbers and text

    Thanks micope21!!

    Sorry for the late reply. Been busy organising the football league.
    I've added rep for you!

    Cheers. ScoobyCon.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1