+ Reply to Thread
Results 1 to 7 of 7

Rankif function - Is there a way to rank based on an argument.

  1. #1
    Registered User
    Join Date
    11-13-2016
    Location
    Brussel
    MS-Off Ver
    office10
    Posts
    3

    Rankif function - Is there a way to rank based on an argument.

    Dear everyone;

    I am trying to create a ranking of clubs, but I only want to rank clubs that satisfy one Criteria
    • Column A = Club number
    • Column B = YES or NO (fit criteria)
    • Column C = Club score (points from 0 to 1500)
    • Column D = Raking (if col B = Yes)

    I tried using the Rank function, but could not tweak to only rank based on Col B = Yes;

    Would anyone know of a solution ?
    Thank you so much for taking the time to look into it.

    attached: a simplified example of what I am trying to do.
    Attached Files Attached Files
    Last edited by JessieMTX; 11-13-2016 at 09:35 AM. Reason: more tags

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

    Re: Rankif function - Is there a way to rank based on an argument.

    Maybe this...

    Data Range
    A
    B
    C
    D
    1
    Club
    Criteria (Yes/no)
    Score
    Rank
    2
    A
    Yes
    1400
    2
    3
    B
    No
    1200
    4
    C
    Yes
    1250
    4
    5
    D
    Yes
    1450
    1
    6
    E
    No
    1300
    7
    F
    Yes
    1350
    3


    This formula entered in D2 and copied down:

    =IF(B2="No","",SUMPRODUCT(--(B$2:B$7="Yes"),--(C2<C$2:C$7))+1)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Rankif function - Is there a way to rank based on an argument.

    In the formula you may have to replace the commas with semi-colons.

  4. #4
    Registered User
    Join Date
    11-13-2016
    Location
    Brussel
    MS-Off Ver
    office10
    Posts
    3

    Re: Rankif function - Is there a way to rank based on an argument.

    Thank you so much @Tony Valko for the quick answer.
    It does work really Well.
    I have not been using this type of function, including SUMproduct etc:
    may I ask what "--" do in this case and what is the prupose of the +1 ?

    Thanks again.
    -Jessie

    PS: you are right, my windows in belgium requires SEMIcolomn instead of COMAs. Once I adjusted this, it all worked:

  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: Rankif function - Is there a way to rank based on an argument.

    For more info on how SUMPRODUCT works see this...

    http://xldynamic.com/source/xld.SUMPRODUCT.html

    We need the +1 to get the correct result.

    Take this example:

    SUMPRODUCT(--(B$2:B$7="Yes"),--(C2<C$2:C$7))

    That is to rank the highest value. However, as is it results in 0. So, we have to add 1 to get the correct result of 1.

  6. #6
    Registered User
    Join Date
    11-13-2016
    Location
    Brussel
    MS-Off Ver
    office10
    Posts
    3

    Re: Rankif function - Is there a way to rank based on an argument.

    Thank you so much for the clarificiation

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

    Re: Rankif function - Is there a way to rank based on an argument.

    You're welcome!

+ 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] "RANKIF" Problem; Unique Rank in One Column, If Value in another Column is Greater than x?
    By WaylettChris in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-26-2014, 02:49 PM
  2. [SOLVED] Rank function, based on 2 criteria / columns
    By Hein in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2013, 11:34 PM
  3. [SOLVED] RANK function - to return data based on 2 different columns
    By Adsup01 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-30-2013, 08:17 PM
  4. [SOLVED] ByRef argument type mismatch / Passing array as a function argument
    By pzling in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-29-2012, 06:23 PM
  5. Change Row to Column Based on Rank Function
    By oyz79 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-17-2011, 11:45 AM
  6. Is there a rankif function
    By Dan in forum Excel General
    Replies: 3
    Last Post: 05-27-2005, 01:05 PM
  7. Function (array argument, range argument, string argument) vba
    By Witek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2005, 11:07 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