+ Reply to Thread
Results 1 to 3 of 3

Need help to rank without any duplicates

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    35

    Need help to rank without any duplicates

    Hi guys,

    I need help with the below. Basically i need to rank each city in each country according to how many units were sold. For example London is ranked first in the UK because it has the most units in the UK. Guangzhou is also ranked first because it has the most units in china. Similarly with Paris. However, Manchester and Glasgow have the same number of units. instead of them both being ranked second i want Glasgow to be second and manchester third because glasgow has the most revenue. Similarly i want Beijing ranked second and jinling 3rd because beijing has the most revenue.

    Country City State Units Revenue Rank I want
    United Kingdom London 50 6164 1
    China Guangzhou 48 6365 1
    France Paris 47 7873 1
    United Kingdom Manchester 46 8369 3
    United Kingdom Glasgow 46 9796 2
    United Kingdom Edinburgh 45 5420 4
    United Kingdom Birmingham 44 9905 5
    United States Buffalo NY 14 5427 1
    China Beijing 10 6614 2
    China Jinling 10 5400 3

    Thanks for you help.

    Thanks

  2. #2
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: Need help to rank without any duplicates

    Depending on how many countries you are dealing with, I would run a sort where the first level is country, the next is number of units, and the third is revenue. You could then add the rankings by dragging down numbers. Due to the sort, everything should be in the correct order and all you have to do is add a rank.

    If you posted a sample worksheet, I believe people would be more willing to help out.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,698

    Re: Need help to rank without any duplicates

    Assuming countries in A2:A100, Units in D2:D100 and Revenue in E2:E100 then try this formula in row 2 copied down for the correct ranks:

    =COUNTIFS(A$2:A$100,A2,D$2:D$100,">"&D2)+COUNTIFS(A$2:A$100,A2,D$2:D$100,D2,E$2:E$100,">"&E2)+1

    data doesn't need to be sorted
    Audere est facere

+ 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