+ Reply to Thread
Results 1 to 5 of 5

Ranking the numbers in order of appearances.

  1. #1
    Registered User
    Join Date
    03-07-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Smile Ranking the numbers in order of appearances.

    Hi,
    Can somebody please help me. I have a set a numbers in one column say A like this.

    6
    6
    4
    4
    4
    3
    3
    2
    1

    All i want is to write a forrmula in each adjacent cell in column B giving me the ranking of these numbers in column A. eg., above here number 6 is appearing twice so I would want it 1 and 2. Number 4 as it appears thrice so it would be 1,2 and 3 and so on. The result would look like this.

    6 1
    6 2
    4 1
    4 2
    4 3
    3 1
    3 2
    2 1
    1 1

    Countif function only gives me the number of times it appears in a range. It does not give me the order of the appearance in the range. Any help will be appreciated. Thanks in advance.

    P.S. The numbers change dynamically based on some results. So the ranking has to be automatic.
    The numbers may or may not be in descending or ascending order. They can be random too.

    Thanks
    Maneesh
    Last edited by maneesh2312; 03-08-2011 at 02:10 AM. Reason: Solved

  2. #2
    Valued Forum Contributor Rahul Nagar's Avatar
    Join Date
    09-18-2008
    Location
    nasik
    MS-Off Ver
    Excel 2003
    Posts
    465

    Re: Ranking the numbers in order of appearances.

    Hi,

    When you use countif function do not select full row select only total data.
    check the attached file.
    I think this would help you.
    Attached Files Attached Files
    __________________
    Regards
    Rahul Nagar
    Founder of www.myshortcutkeys.com.


    If you get the answer of your questions then please click EDIT in your original post then click on GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.

  3. #3
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Ranking the numbers in order of appearances.

    Hi, countif should solve your problem

    =COUNTIF($A$2:A2;A2)
    Same service from:

    =SUMPRODUCT(($A$2:$A$1000=$A2)*($A2<$A$2:$A$1000))+SUMPRODUCT((A$2:$A2=$A2)*(A$2:$A2=$A2))
    Regards

    नमस्ते
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Ranking the numbers in order of appearances.

    @maneesh2312, please note:

    Your post does not comply with Rule 8 of our Forum RULES.

    Cross-posting is when you post the same question in other forums on the web.

    You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere.

    We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post.

    Read this to understand why we ask you to do this

  5. #5
    Registered User
    Join Date
    03-07-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Smile Re: Ranking the numbers in order of appearances.

    Thanks a lot Rahul & Canapone. This was exactly what I wanted.

    @DonkeyOte: This was the first time I posted something in a forum and so was not aware of that. Will see to it next time.

    Thanks All
    Maneesh

+ 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