+ Reply to Thread
Results 1 to 9 of 9

Rank subgroups without duplicates

  1. #1
    Registered User
    Join Date
    07-20-2018
    Location
    Exeter, England
    MS-Off Ver
    2016
    Posts
    7

    Rank subgroups without duplicates

    Hi

    I am looking to rank subgroups within excel. Each subgroup needs to be ranked without skipping numbers if their are duplicates.

    I have attached a exemplar of the data. For each participant I want the years ranked in order without skipping numbers. The rank column shows the data I want the formula to calculate.

    I am struggling to find the correct formula for this. Any help would much appreciated.

    Thanks

    Philip
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Rank subgroups without duplicates

    Sorry I do not understand the logic behind this... You need to explain HOW you derived your expected results.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    07-20-2018
    Location
    Exeter, England
    MS-Off Ver
    2016
    Posts
    7

    Re: Rank subgroups without duplicates

    Hi Glenn

    My expected results in the rank column were manually inputted. Hopefully there is a formula to calculate this that I can use for multiple participants.

    What I need the formula to do is:
    - Separately rank each participant (treat each participant as a separate subgroup).
    - For each participant rank the year that they provided data (the oldest year will receive a ranking of 1 and the most recent year will receive the highest numbered ranking in the sub-group).
    - The formula should not skip ranks. (If the first two years for a participant are 1994's, both should be ranked 1 and the following year will be ranked 2).

    Essentially I am trying to order the years that each participant provided data to allow me to conduct longitudinal analysis.

    Hope this provides some clarity.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Rank subgroups without duplicates

    Clear!! I was focussing on the year, not the participant and was getting very muddled. back in 5 mins...

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Rank subgroups without duplicates

    Hi. This will do it.

    =SUMPRODUCT((B2>B$2:B$24)*($A$2:$A$24=A2)/COUNTIFS($A$2:$A$24,$A$2:$A$24,B$2:B$24,B$2:B$24))+1
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-20-2018
    Location
    Exeter, England
    MS-Off Ver
    2016
    Posts
    7

    Re: Rank subgroups without duplicates

    Thanks for that Glenn.

    The formula appears to work. However, when I extend it to fit the 486687 rows of data I have by changing 24 in all the $A$24 and $B$24 to 486687, the calculation seems to return zero for each cell. I'm not sure if this is because the formula is too complex for the large data set I have, but it does show a message in excel saying "Calculating: (4 Processor(s)) : 0%".

    Is there a reason why this formula may not be calculating correctly when I include more rows of data? Or is there a less complex formula that returns the same results?

    Thanks for your help.

    Phil

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Rank subgroups without duplicates

    With 500,000 rows you will need to either: learn to be patient and wait, or get someone to write a VBA solution. You should have stated up front that you wanted a solution that would work for half a million rows!!

  8. #8
    Registered User
    Join Date
    11-10-2012
    Location
    egypt
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Rank subgroups without duplicates

    realy thank u soooooooooooooo much , but can doing it with vba ?


    thank u again
    Last edited by sallame; 12-09-2021 at 08:24 AM.

  9. #9
    Registered User
    Join Date
    04-22-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Rank subgroups without duplicates

    Great solution brother. thank you very much

+ 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. Trying to Rank within Subgroups of one column
    By gemispence in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-26-2015, 05:08 PM
  2. Need help to rank without any duplicates
    By hawkinsr86 in forum Excel General
    Replies: 2
    Last Post: 10-29-2012, 12:41 PM
  3. [SOLVED] RANK formula cannot rank duplicates
    By unpluggedmusic in forum Excel General
    Replies: 5
    Last Post: 10-13-2012, 12:59 PM
  4. Weighted rank- if duplicates rank the average
    By vlady in forum Excel General
    Replies: 3
    Last Post: 02-28-2012, 09:17 PM
  5. Rank formula and duplicates
    By jimstrongy in forum Excel General
    Replies: 6
    Last Post: 01-15-2012, 12:21 PM
  6. Rank duplicates by another column
    By felix11 in forum Excel General
    Replies: 2
    Last Post: 09-11-2010, 10:02 PM
  7. Excel Rank Duplicates then preferred rank
    By Economic in forum Excel General
    Replies: 2
    Last Post: 04-05-2009, 07:45 PM

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