+ Reply to Thread
Results 1 to 8 of 8

RANK values above 0

  1. #1
    Registered User
    Join Date
    03-08-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    33

    Question RANK values above 0

    Hi

    I've been pondering this for about an hour using various permutations of RANK and IF function but I am at a loss.
    I need to rank the following but exclude anything less than or equal to zero so I should be left with 5 positive numbers ranked 1 to 5. There does not seem to be a RANKIF function, unless I'm missing something.

    Many thanks for your help in advance.

    0.00
    0.00
    0.14
    0.55
    0.52
    -0.20
    -0.69
    -0.26
    0.92
    0.80
    -0.33
    -0.48
    -0.76
    -0.17
    -0.76

  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,129

    Re: RANK values above 0

    Assuming your data start in A2, use this in B2, copied down.

    It's an array formula.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    =IFERROR(LARGE(IF($A$2:$A$16>0,$A$2:$A$16),ROWS($B$2:B2)),"")
    Attached Files Attached Files
    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

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,306

    Re: RANK values above 0

    Try this (data in A1:A15)

    in B1 and copy down

    =IF($A$1:$A$15>0,COUNTIF($A$1:$A$15,">=" &A1),"")

  4. #4
    Registered User
    Join Date
    03-08-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    33

    Re: RANK values above 0

    ok, my apologies I should have mentioned that the cell that the ranking formula looks at contains numbers from a vlookup or index match so the cells do not technically contain the data, if that makes any sense. I can't do the ranking on the original because it comes from a data dump and while the columns don't move I don't want to include all the data.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: RANK values above 0

    It shouldn't matter that the numbers are the results of other formulas.

    If this is your data:

    0.00
    0.00
    0.14
    0.55
    0.52
    -0.20
    -0.69
    -0.26
    0.92
    0.80
    -0.33
    -0.48
    -0.76
    -0.17
    -0.76

    Show us what results you expect.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    03-08-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    33

    Re: RANK values above 0

    It seems to be working now, not sure why it went a bit funny. Many thanks

  7. #7
    Registered User
    Join Date
    03-08-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    33

    Re: RANK values above 0

    Quote Originally Posted by JohnTopley View Post
    Try this (data in A1:A15)

    in B1 and copy down

    =IF($A$1:$A$15>0,COUNTIF($A$1:$A$15,">=" &A1),"")
    Just out of curiosity how would you change the formula to reverse the ranking order? I tried swapping the >= to <= but that didn't work, it came up with even larger numbers.

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,919

    Re: RANK values above 0

    Largest to Small:

    =IF(A1<=0,"",COUNTIF($A$1:$A$16,">"&A1)+1)

    Small to Largest:

    =IF(A1<=0,"",COUNTIFS($A$1:$A$16,">0",$A$1:$A$16,"<"&A1)+1)

+ 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. [SOLVED] Formula to RANK groups of Values and return B+? or B-? values
    By hammer2 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-27-2015, 07:48 AM
  2. rank values within the same ID
    By dwx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2014, 12:56 PM
  3. Replies: 10
    Last Post: 09-16-2014, 01:24 PM
  4. Replies: 8
    Last Post: 02-20-2014, 07:03 PM
  5. RANK - Non unique values, contiguous rank required
    By PaulBo in forum Excel General
    Replies: 9
    Last Post: 02-20-2014, 10:34 AM
  6. NoobQ: Rank function treats negative values as positive values. Help!
    By lutonoodles in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-12-2013, 02:10 PM
  7. Formula to Rank and populate values base don Rank
    By Excel Dumbo in forum Excel General
    Replies: 3
    Last Post: 10-09-2012, 02:02 AM

Tags for this Thread

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