+ Reply to Thread
Results 1 to 6 of 6

Formula to rank persons by state in each country (2 groups/criteria)

  1. #1
    Registered User
    Join Date
    10-02-2005
    Posts
    8

    Formula to rank persons by state in each country (2 groups/criteria)

    Hello,

    I would like to rank a list of persons (represented by their ID) at State/Province level based on their worldrank value (the lower the value the higher the rank).
    For example Persons in the united states ranked by each state based on their worldrank; it is a sub ranking by state/province. I could rank based on the state/province name only and forget about the country but the issue is that in some countries there are states/provinces with the same name. For example both Argentina and Colombia have a province called Cordoba. So if I apply the usual ranking formula based on one criteria/group the result is that it considers cordoba in the same state ranking and does not create one state/province ranking for the two different countries.
    What formula should I use to create different state/province rankings based first on the country and then the state/province (not just one group/criteria but two).

    I attach the worksheet hoping it will help understand better the issue.

    Thanks for any help!

    world33
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Formula to rank persons by state in each country (2 groups/criteria)

    You can use sort function. see attached. I changed the world rank column D values to numbers.
    Attached Files Attached Files
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  3. #3
    Registered User
    Join Date
    10-02-2005
    Posts
    8

    Re: Formula to rank persons by state in each country (2 groups/criteria)

    Hi Modytrane,

    The states were already sorted. How would that make a difference?

    ty

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Formula to rank persons by state in each country (2 groups/criteria)

    I think you need to provide what the format of your output is in the model answer. Modytrane has provided an answer that works. However as you have not given a sample answer it is probably different to what you are after. why not reduce the data to a few lines as well to make the task easier

  5. #5
    Registered User
    Join Date
    10-02-2005
    Posts
    8

    Re: Formula to rank persons by state in each country (2 groups/criteria)

    Thanks for the feedback. I have updated the worksheet to highlight the issue.
    By using the following formula

    =1+SUMPRODUCT(($C$2:$C$5000=C2)*($D$2:$D$5000<D2))

    Which does not include the Country criteria it happens that states/provinces with the same name in different countries are ranked in the same sub-ranking.
    How can I modify the formula so that I can add an additional criteria based on the country to prevent this problem?

    I hope it is clearer now.

    TY
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Formula to rank persons by state in each country (2 groups/criteria)

    I wouldn't do things your way, however if you wanted to expand it

    =1+SUMPRODUCT(($B$2:$B$5000=B2)*($C$2:$C$5000=C2)*($D$2:$D$5000<D2))

+ 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: 2
    Last Post: 01-29-2015, 06:25 PM
  2. City/ State/ Country to TimeZone conversion
    By vij8y in forum Excel General
    Replies: 3
    Last Post: 09-22-2014, 02:21 AM
  3. importing city state and country from a ZIPTASTIC website
    By nate02167 in forum Excel General
    Replies: 2
    Last Post: 09-10-2013, 11:06 AM
  4. Formaula to show specific State/City in a Country
    By Sarisha in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-16-2013, 12:01 PM
  5. Trying to have country field automated when state/province chosen
    By GregB4 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2012, 05:39 PM
  6. State and country check macro
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 37
    Last Post: 06-29-2009, 08:35 PM
  7. Macro Help:State/Country.
    By Philip White via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2005, 10:05 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