+ Reply to Thread
Results 1 to 4 of 4

Ranking - Non unique Values : Small To Large

  1. #1
    Registered User
    Join Date
    04-21-2008
    Posts
    11

    Ranking - Non unique Values : Small To Large

    I'm trying to rank data where more than one cell may contain the same value, but the ranking will skip a number.

    I'm trying to get it to rank from small to large.

    DaddyLongLegs posted a really good solution:
    =SUM(--ISNUMBER(MATCH(ROW(INDIRECT("1:"&RANK(A1,A$1:A$6))),RANK(A$1:A$6,A$1:A$6),0)))
    confirmed with CTRL+SHIFT+ENTER

    (http://www.excelforum.com/excel-gene...-required.html)

    but what it does is rank values from big to small. Is there a way to invert this formula to get it to go from small to big?

    Thanks!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Ranking - Non unique Values : Small To Large

    try changing the last 0 (...RANK(A$1:A$6,A$1:A$6),0)))...to 1
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Ranking - Non unique Values : Small To Large

    You would need to rank ascending..

    Hence use
    =SUM(--ISNUMBER(MATCH(ROW(INDIRECT("1:"&RANK(A1,A$1:A$6,1))),RANK(A$1:A$6,A$1:A$6,1),0)))
    Confirm with Ctrl+Shift+Enter

    FDibbins' suggestion will change the MATCH function to a 'less than' MATCH and not an 'exact' match instead of inverting the rank order, hence will not work
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Ranking - Non unique Values : Small To Large

    @ Ace_XL thx for the catch, i didnt notice the formula didnt have a "0" in the rank function, and read the match-1 as belonging to the rank function

+ 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