+ Reply to Thread
Results 1 to 7 of 7

Sort using formulas?

  1. #1
    Registered User
    Join Date
    11-07-2010
    Location
    Spring, TX
    MS-Off Ver
    Excel 2013
    Posts
    19

    Sort using formulas?

    Hi all,

    I've been working on this problem for several days now and have decided to give up and see if I can get some help. My situation is this: I have the standings from a soccer league, and I want to display them in the correct order (first place through twentieth place). I have attached a file here with all the information needed. The way to determine which team is in which place is as follows:
    1. Most points (column C)
    2. Greatest goal differential (column J)
    3. Most goals scored (column H)
    4. Alphabetical by team name (column B)

    So in this case, TeamA and TeamB should really be in first and second place as shown here, but TeamD should really be in 3rd place because it has the same amount of points as TeamC but a greater goal differential.

    It would be quite easy to accomplish this task using a sort on all these cells. I would simply include four levels in the sort as I outlined here above. The problem is that for my purposes I need to accomplish this using formulas. I have made various attempts at this using the RANK formula, but haven't been able to get my whole task done.

    Thanks in advance for any help you can give me and please let me know if any of the above is unclear.

    Thanks,
    Mike
    Attached Files Attached Files
    Last edited by mschatz2; 11-09-2010 at 11:58 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sort using formulas?

    Kind of hard to explain, take a look.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,983

    Re: Sort using formulas?

    Have you considered a macro to do the manual sort?
    Please Login or Register  to view this content.
    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    11-07-2010
    Location
    Spring, TX
    MS-Off Ver
    Excel 2013
    Posts
    19

    Re: Sort using formulas?

    Quote Originally Posted by JBeaucaire View Post
    Kind of hard to explain, take a look.
    Thank you very much, Jerry, for taking the time to respond. Looking at your file, it appears that my problem is very close to being solved. The one problem that I see is that a couple rankings are still off. TeamA, for example, should be in first place because it is tied for having the most points (6) and it has the best goal differential (+6). The fact that it has less goals scored than TeamB is irrelevant as their tiebreaker was already solved by the goal differential. Likewise, TeamT should be in last place (20th place) because it has 0 points a a worse goal differential (-8) than any of the other 0 point teams.

    Also, for the 4th and final tiebreaker, this should be team name in alphabetical order. I made this point perhaps more confusing than it needed to be by changing the real team names to these generic names (which were already in alphabetical order). I have put the real team names in the updated attached files to make more clear the issue of putting the teams in alphabetical order if the first 3 tiebreakers are equal (as is the case with Belgrano and Chicago in this example).

    Thanks again for your help with this.

    Mike

    P.S. Thanks, Alansidman, for the suggestion, but I really need the solution to be in the form of formulas instead of a macro. Thanks again.
    Attached Files Attached Files

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sort using formulas?

    To be simple and accurate, since you have 3 sets of columns to rank on then you also need 3 progressive rank columns to solve it properly.

    The "alphabetical" final step requires you actually put the table in alphabetical order, so I sorted the table properly so the final rank column works.

    You can actually hide columns E:G so the only thing showing for "results" is the table in J:K.
    Attached Files Attached Files
    Last edited by JBeaucaire; 11-09-2010 at 11:57 AM.

  6. #6
    Registered User
    Join Date
    11-07-2010
    Location
    Spring, TX
    MS-Off Ver
    Excel 2013
    Posts
    19

    Re: Sort using formulas?

    Quote Originally Posted by JBeaucaire View Post
    To be simple and accurate, since you have 3 sets of columns to rank on then you also need 3 progressive rank columns to solve it properly.

    The "alphabetical" final step requires you actually put the table in alphabetical order, so I sorted the table properly so the final rank column works.

    You can actually hide columns E:G so the only think showing for "results" is the table in J:K.
    Perfect! This solves my problem completely. Thank you very much for your help.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sort using formulas?

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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