+ Reply to Thread
Results 1 to 3 of 3

Rank duplicates by another column

  1. #1
    Registered User
    Join Date
    09-11-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Rank duplicates by another column

    Hi,

    Is it possible to give ranks to duplicate values based on the values in another column? Each set of duplicate values should have its own rank set. I can do it for a small dataset using a combination of IF, INDEX and SMALL and then using the RANK function on what this returns, but I could not automate this for a large dataset.

    An example is
    Object Year
    A 2001
    B 2004
    C 1987
    C 1999
    A 1955
    C 2006
    A 2009

    I want to return the rank of A compared to the other A's based on their year, i.e.
    Rank
    2
    1
    3
    2
    3
    1
    1

    Any help would be much appreciated, I have been trying for a while now.
    Last edited by NBVC; 09-11-2010 at 10:13 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Rank duplicates by another column

    Assuming data is in A1:B7, try:

    =SUM(IF(IF($A$1:$A$7=A1,$B$1:$B$7,0)>B1,1))+1

    confirmed with CTRL+SHIFT+ENTER and copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    09-11-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Rank duplicates by another column

    Thank you very much! Works fine.

    I often completely overlook/forget array functions in cases they're perfectly suited to.

+ 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