+ Reply to Thread
Results 1 to 8 of 8

Ranking a dynamic range containing blanks

  1. #1
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Ranking a dynamic range containing blanks

    Hi guys,

    I have a range of cells from A1 to A65 which is populated with formulas to fill with numbers depending on what option is selected from the list box.

    The values which populate need to be ranked in column B. (highest value - 1, second higest -2 etc)

    Not all cells are populated, some will return a "" (blank) value, these are scattered throughout the range.

    I need ONLY the populated cells to be ranked.( the cells which return a "" value should be ignored) These blank cells are scattered throughout the range.

    I need to rank them with NO DUPLICATE ranks (eg, if 2 values are the same, the rank must still incriment and be different for each entry)

    I am at a brink wall so as always your help will be much appreciated!!

    Thanks!
    Last edited by freud1; 11-17-2010 at 12:15 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Ranking a dynamic range containing blanks

    This might help:(the file you want is Rank-TieBreaking.xls)


    ==========
    Some various snippets:

    =RANK(B1,B$1:B$20)+COUNTIF(B$1:B1,B1)-1
    'positional solution, higher in list wins

    =RANK($B2,$B$2:$B$15,1)+SUMPRODUCT(($B$2:$B$15=$B2)($C$2:$C$15>$C2))
    'tie breaker values used in additional column
    http://www.mrexcel.com/forum/showthread.php?t=428947

    'RANK with 1st,2nd,3rd format automatically
    =RANK(I2,$I$2:$I$11)&MID("thstndrdth",MIN(9,2*RIGHT(RANK(I2,$I$2:$I$11))*(MOD(RANK(I2,$I$2:$I$11)-11,100)>2)+1),2)
    http://www.officekb.com/Uwe/Forum.as...-2nd-positions

    =RANK(I2,$I$2:$I$11)&MID("thstndrdth",MIN(9,(RIGHT(RANK(I2,$I$2:$I$11))-1)*2+3),2)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Re: Ranking a dynamic range containing blanks

    Thanks for your help Jerry, however im not too sure if any of these would account for what i'm looking for as I have no 'tie break situation'

    I have attached an example sheet to better highlight my needs...
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Ranking a dynamic range containing blanks

    Well, you do have some ties, all the cells with a value of zero, for instance.

    Anyway, something like this in D3, then copied down:

    =IF(A3="","",RANK(B3,B:B))

    or

    =IF(OR(A3="",B3=0),"",RANK(B3,B:B))

  5. #5
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Re: Ranking a dynamic range containing blanks

    Jerry!

    you have single handedly saved my job too many times!

    Beers for you from me this xmas!! .... at least virtual ones!

    many many many thanks!!

  6. #6
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Re: Ranking a dynamic range containing blanks

    Jerry, I just noticed,

    This doesnt account for duplicates.

    Is it possible to still uniquely number duplicates?

    i used

    =IF(OR(A3="",B3=0),"",RANK(B3,B:B))

    If two values are identical they will both be ranked fro example as 5, i need them to rank as 5, then 6 even if they are the same.

    hope this makes sense?

    thanks

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Ranking a dynamic range containing blanks

    I gave you snippets above to deal with duplicates. Try the first one edited for your formula.

    You can do it.

  8. #8
    Registered User
    Join Date
    06-13-2011
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Ranking a dynamic range containing blanks

    Thanks this one helped me also.

+ 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