+ Reply to Thread
Results 1 to 6 of 6

IF Function with ranking

  1. #1
    Registered User
    Join Date
    03-03-2016
    Location
    ON
    MS-Off Ver
    Office 2013
    Posts
    5

    IF Function with ranking

    Hi guys,

    I don't know if you guys can help me find a formula for the following:

    Player City Points
    A New York 12
    B L.A. 30
    C Chicago 22
    D Chicago 15
    E Boston 27
    F New York 18
    G Boston 11
    H Chicago 25
    I Chicago 26

    So I have a list of players, their cities and the points they have. I would like a formula that would show me the highest ranking player by city. What I am trying to accomplish is entering a city (i.e., New York) and the result would be Player F (highest ranking player from NY).

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: IF Function with ranking

    =INDEX(A1:C9,MATCH(MAX(IF(E1=B1:B9,C1:C9)),C1:C9,0),1)
    Array formula, use Ctrl-Shift-Enter

    NOTE: This does not cater for players where points are tied, ie it will only return the FIRST highest ranking not all
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: IF Function with ranking

    Or a non array formula
    =INDEX($A$1:$A$9,MOD(AGGREGATE(14,6,($C$1:$C$9+ROW($C$1:$C$9)/100)*--($B$1:$B$9=E1),1),1)*100,1)

    Note: E1:E4 is a list of cities.

  4. #4
    Registered User
    Join Date
    03-03-2016
    Location
    ON
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: IF Function with ranking

    What would be the modification to this formula if I wanted to created a table that ranked the players of a certain city by their points? (ie, 1st place, 2nd place, 3rd place, etc...)

    Thanks!

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: IF Function with ranking

    Quote Originally Posted by ygao85 View Post
    What would be the modification to this formula if I wanted to created a table that ranked the players of a certain city by their points? (ie, 1st place, 2nd place, 3rd place, etc...)
    How about a pivot table that filters cities using either a slicer or report filter. The player names would be assigned as row labels and the points would be values with a sort largest to smallest applied.
    Here is a copy of your file with a pivot table applied: Ranking by two criteria.xlsx
    Let me know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

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

    Re: IF Function with ranking

    Quote Originally Posted by Special-K View Post
    =INDEX(A1:C9,MATCH(MAX(IF(E1=B1:B9,C1:C9)),C1:C9,0),1)
    That formula could return an incorrect result if the max number also corresponds to a different team.

    Data Range
    A
    B
    C
    D
    E
    F
    1
    A
    New York
    12
    New York
    C
    2
    B
    L.A.
    30
    3
    C
    Chicago
    18
    4
    D
    Chicago
    15
    5
    E
    Boston
    27
    6
    F
    New York
    18
    7
    G
    Boston
    11
    8
    H
    Chicago
    25
    9
    I
    Chicago
    26
    10
    ------
    ------
    ------
    ------
    ------
    ------


    Try it like this...

    =INDEX(A1:A9,MATCH(MAX(IF(B1:B9=E1,C1:C9)),IF(B1:B9=E1,C1:C9),0))

    Still array entered.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Replies: 3
    Last Post: 02-08-2016, 06:55 PM
  2. [SOLVED] Ranking Function Within Excel
    By jcl6543 in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 09-08-2014, 01:56 PM
  3. Two-Variable Ranking Function
    By salohcin714 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-17-2014, 03:05 PM
  4. [SOLVED] Help with the ranking function
    By XavierC in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-31-2013, 01:38 PM
  5. Ranking function problem
    By JoeN in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-13-2013, 02:27 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. Frequency + Ranking Function.
    By myteam in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-26-2010, 04:33 AM

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