+ Reply to Thread
Results 1 to 13 of 13

Ranking and Grouping Data

Hybrid View

  1. #1
    Registered User
    Join Date
    05-20-2011
    Location
    Minnesota
    MS-Off Ver
    Excel for Mac - Office 365
    Posts
    18

    Ranking and Grouping Data

    Hello, I'm working on a project where I need to group golfer scores into groups of 6 with certain criteria. I thought about using Solver, but I have over 500 golfer scores in my database. I've attached a spreadsheet for review.

    Goal: Maximize the score of each group
    Criteria:
    1) Each group must have 6 scores in it: 3 from members from Team A and 3 from members from Team B
    2) No golfer name may be repeated in the same group (for example, there's 3 Corey Conners listed here, but he may only be in a single group once)
    2B) Some golfers posted scores for either team, so again as is the example with Corey Conners, he has a score entry for Team A and Team B

    I'm looking to do this via formula, and not VB if possible.

    Thank you for any assistance.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-20-2011
    Location
    Minnesota
    MS-Off Ver
    Excel for Mac - Office 365
    Posts
    18

    Re: Ranking and Grouping Data

    If I may elaborate, I think it's easy to rank all the scores from Team A and group them accordingly (Group 1 has Team A ranks 1, 2, 3... Group 2 has Team A ranks 4, 5, 6, etc.), however, the wild card is a name can't be listed twice. So in the example above, as "Corey Conners" has 3 entries, he can only show up in Group 1 once, then potentially Group 2 once, etc.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Ranking and Grouping Data

    Yes. I've encountered that. So far all my "solutions" swap duplicates for blanks.

    Still working on it.

    BTW: I've been working on the assumption you want this all done in one spilling array formula. Is separate formulas for each Team acceptable?

    EDIT: Regarding the duplicates as I understand the clarified instructions Post#2 it is apparently acceptable to have Corey Conners in both Team A and Team B summaries. Is this correct?
    Last edited by FlameRetired; 12-28-2023 at 03:39 PM.
    Dave

  4. #4
    Registered User
    Join Date
    05-20-2011
    Location
    Minnesota
    MS-Off Ver
    Excel for Mac - Office 365
    Posts
    18

    Re: Ranking and Grouping Data

    Hi Dave, thanks for the reply. I think either a spill or separate formula works, but ultimately the groups are fused together (3 members from Team A and 3 from Team B). "Corey Conners" will have entries on both Team A and Team B, but he can't be listed under Team A and Team B in the same group.

    So, say for instance Corey Conners has the top 5 scores overall, 3 of them while playing for Team A and 2 while playing for Team B. I'd expect him to show up in Groups 1, 2, 3 for his Team A, while in group 4 and 5 for Team B. So, he's included in the "Top 5" groups, but only once in each, if that makes sense.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Ranking and Grouping Data

    OK.
    Let's see if I understand correctly.

    In the attached please find this formula in F3 copied down and across.
    Formula: copy to clipboard
    =IFERROR(INDEX(UNIQUE(CHOOSECOLS(SORT(FILTER($A$3:$C$26,CHOOSECOLS($A$3:$C$26,2)=
    MID(F$2,6,1)),3),1)),($E3-1)*3+COUNTIF($F$2:F$2,LEFT(F$2,6)&"*")),"")


    It returns


    E
    F
    G
    H
    I
    J
    K
    2
    Final Group
    Team A - 1
    Team A - 2
    Team A - 3
    Team B - 1
    Team B - 2
    Team B - 3
    3
    1
    Tom Hoge
    Keith Mitchell
    Ryan Armour
    Sepp Straka
    Kurt Kitayama
    Adam Schenk
    4
    2
    Sungjae Im
    Adam Schenk
    Chesson Hadley
    Byeong Hun An
    Corey Conners
    Mackenzie Hughes
    5
    3
    Corey Conners
    Andrew Novak
    Lucas Glover
    Nick Hardy
    Harry Higgs
    Ryan Moore
    6
    4
    Scottie Scheffler
    Billy Horschel
    Stewart Cink
    Scottie Scheffler
    Attached Files Attached Files

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Ranking and Grouping Data

    After rereading post#4 I don't think I still understand.

    Please upload a duplicate of your first workbook but this time include the desired results hand typed across F3:K6.

  7. #7
    Registered User
    Join Date
    05-20-2011
    Location
    Minnesota
    MS-Off Ver
    Excel for Mac - Office 365
    Posts
    18

    Re: Ranking and Grouping Data

    Done. See attached. I also added a column "D' to show the placement of each player's score within the groups. Hope this makes sense. It definitely has some logic built into it to properly allocate scores. Also, I sorted the scores in Column "C" to show the order of importance. Again, I'm trying to essentially get to Group 1 being the 6 best, name-non-duplicated scores of the year.
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Ranking and Grouping Data

    I still don't get it. I've sent out a call for community help. Stand by. Someone may be able to 'whip' this.

  9. #9
    Registered User
    Join Date
    05-20-2011
    Location
    Minnesota
    MS-Off Ver
    Excel for Mac - Office 365
    Posts
    18

    Re: Ranking and Grouping Data

    It is a bit complicated, yes. I think UNIQUE is a useful formula here, to ensure 6 names are not duplicated across one Group. The syntax of having a formula loop back to grab prior results in a non-linear fashion might be more of a programming approach, unfortunately.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Ranking and Grouping Data

    Yes to do that by formula would create a circular reference.

    Unfortunately I am not at all strong in VBA. All I can do is move your thread to that sub forum. Would you like me or any other of the Moderators/Admin do that for you?

  11. #11
    Registered User
    Join Date
    05-20-2011
    Location
    Minnesota
    MS-Off Ver
    Excel for Mac - Office 365
    Posts
    18

    Re: Ranking and Grouping Data

    Yes, that's fine. Thank you kindly for chaperoning this through.

  12. #12
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,016

    Re: Ranking and Grouping Data

    I'm not sure whether this formula is correct?

    You must check it by yourself.

    =LET(
      a,FILTER(A3:A100,B3:B100="A"),
      b,FILTER(A3:A100,B3:B100="B"),
      c,DROP(REDUCE({0,0},SEQUENCE(ROWS(a)),LAMBDA(x,y,VSTACK(x,HSTACK(INDEX(a,y),IF(SUM(--(INDEX(x,,1)=INDEX(a,y))),MAX((INDEX(x,,1)=INDEX(a,y))*INDEX(x,,2))+3,  MIN(MAP(SEQUENCE(y),LAMBDA(z, IF(SUM(--(INDEX(x,,2)=z)),"",z))))))))),1),
    d,DROP(REDUCE({0,0},SEQUENCE(ROWS(b)),LAMBDA(x,y,VSTACK(x,HSTACK(INDEX(b,y),IF(SUM(--(INDEX(x,,1)=INDEX(b,y)))+SUM(--(INDEX(TAKE(a,y),,1)=INDEX(b,y))),MAX((INDEX(x,,1)=INDEX(b,y))*INDEX(x,,2), IFERROR(((INDEX(TAKE(c,MIN(y,ROWS(c))),,1)=INDEX(b,y))*INDEX(TAKE(c,MIN(y,ROWS(c))),,2)),100))+3,  MIN(MAP(SEQUENCE(y),LAMBDA(z, IF(SUM(--(INDEX(x,,2)=z)),"",z))))))))),1),
     IFERROR(HSTACK(WRAPROWS(TAKE(SORTBY(c,INDEX(c,,2)),,1),3),WRAPROWS(TAKE(SORTBY(d,INDEX(d,,2)),,1),3)),"")
    )
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    05-20-2011
    Location
    Minnesota
    MS-Off Ver
    Excel for Mac - Office 365
    Posts
    18

    Re: Ranking and Grouping Data

    This is an impressive formula. It will take me a bit to learn and digest. I'm going to deploy it against my local copy of the full data set and see if it works.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 11-06-2020, 05:45 PM
  2. [SOLVED] RANKING with Multiple Criteria Without Skipping OR Sequential Ranking
    By e4excel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-24-2020, 01:08 AM
  3. Ranking Question - Ranking based criteria but having forumla value issues
    By harp1983 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-09-2016, 07:03 AM
  4. Replies: 3
    Last Post: 02-08-2016, 06:55 PM
  5. Replies: 4
    Last Post: 07-26-2014, 02:35 AM
  6. Grouping and Ranking within Groups
    By penfold in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-21-2010, 01:05 PM
  7. Ranking Dates and Grouping Together
    By scottymelloty in forum Excel General
    Replies: 4
    Last Post: 02-07-2006, 10:41 AM

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