+ Reply to Thread
Results 1 to 12 of 12

Conditional ranking

  1. #1
    Registered User
    Join Date
    08-14-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    4

    Question Conditional ranking

    Hello,

    I want to rank a spread sheet based on the values of a column, but only if the next column is blank, if it is not blank then use a value in another column but this is including all of the values from the next column and not excluding the value from the initial column.

    i am trying

    =IF(C2="",RANK(B2,B$2:B$10,1),RANK(D2,(B$2:B$10,D$2:D$10),1))

    It is ranking them by all the numbers in the spread sheet, as you can see in the sample two are ranked as 1 and the rank goes up to 18 not 9.

    Thanks in advance for any help and please ask any questions if i haven't explained myself fully.

    Surn
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Conditional ranking

    Indeed, it's not clear what you would like to achieve. As there is just 9 rows of data - tell us what are expected (manually calculated) results.
    Best Regards,

    Kaper

  3. #3
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Conditional ranking

    Hi

    Try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    To help you by my post? it would be nice to click on to say "Thank you".
    If you are happy with a solution to your problem?
    Click Thread Tools above your first post,
    select "Mark your thread as Solved".

  4. #4
    Registered User
    Join Date
    08-14-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    4

    Re: Conditional ranking

    Hi,

    Thanks for the replies. Micope21 that didnt work but thanks for trying. I want the results ranked 1-9 or 9-1 (doesnt really matter) it will do this for the first column if none of cheat are filled, when i fill cheat i want to replace the data from score 1 with score 2, I have attached a new sample with how it should rank. The problem is i only want to include the data from score 2 if cheat is filled in. The inclusion of data must be conditional on the cheat column being filled.

    Hope this makes it clearer

    Surn
    Attached Files Attached Files

  5. #5
    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
    43,984

    Re: Conditional ranking

    If you are OK with a helper column in this case in column H - can be hidden):

    =IF($D$2:$D$10="y",$E$2:$E$10,$C$2:$C$10)

    then use this:

    =RANK(H2,$H$2:$H$10,1)
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional ranking

    Formula
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    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
    43,984

    Re: Conditional ranking

    Thank you kvsrinivasamurthy. I had been getting totaly tangled up with SUMPRODUCT, gave up and went for the alternative (+ helper) approach.

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,911

    Re: Conditional ranking

    =SUM(INDEX(((Table2[cheat]="Y")*(Table2[[score 2 ]])+(Table2[cheat]<>"Y")*(Table2[score 1])<IF(Table2[[#This Row],[cheat]]="Y",Table2[[#This Row],[score 2 ]],Table2[[#This Row],[score 1]]))*1,0))+1
    Please Login or Register  to view this content.
    try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional ranking

    Welcome Glenn Kennedy . I just wanted to avoid helper column.

  10. #10
    Registered User
    Join Date
    08-14-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    4

    Re: Conditional ranking

    Thanks for the help guys, I have managed to get it working for two columns but i want to stack it up for 4 and now it just says true or false.
    Both the methods are great but my understanding of the format is not good enough. I would like it to say void if all 4 cheat columns are filled in.
    I have attached an example based on the original one.

    Thanks in advance

    Surn
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    08-14-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    4

    Re: Conditional ranking

    I am trying

    =SUMPRODUCT(--(([score 1]*([cheat]="")+[[score 2 ]]*([cheat]<>"")+[score 3]*([cheat]<>"")*([cheat2]<>""))<IF([@cheat]="",[@[score 1]],IF([@cheat2]="",[@[score 2 ]],[@[score 3]] ))))+1

    for 3 columns but now it is ranking it up to 10

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Conditional ranking

    Slightly changing table value (In red) I guessed Formula is
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 08-19-2015 at 01:41 PM.

+ 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. Conditional Formatting Formula for Percentage Ranking
    By josh86 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-18-2014, 10:29 PM
  2. Conditional Ranking
    By erudkin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-18-2014, 12:19 PM
  3. [SOLVED] Conditional ranking with a twist
    By BWellman in forum Excel General
    Replies: 3
    Last Post: 01-22-2014, 03:26 PM
  4. [SOLVED] Conditional Formatting for Ranking sales
    By BullseyeThor in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-03-2012, 09:12 AM
  5. Conditional ranking in VBA
    By cesarez in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2012, 12:55 PM
  6. Conditional ranking using the Sumproduct function
    By helium in forum Excel General
    Replies: 3
    Last Post: 07-04-2012, 08:26 PM
  7. Conditional Ranking Data with Array Formula
    By memokiller in forum Excel General
    Replies: 2
    Last Post: 03-15-2012, 04:48 PM
  8. Ranking conditional groups... but negative figures...
    By tangcla in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-23-2008, 06:29 PM

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