+ Reply to Thread
Results 1 to 9 of 9

How to Rank duplicated categories in a list

  1. #1
    Registered User
    Join Date
    06-03-2013
    Location
    London, England
    MS-Off Ver
    Excel M365
    Posts
    73

    Talking How to Rank duplicated categories in a list

    Hi,

    Thanks in advance for your help. I have a list below which is very long, for the cost entry in column A there are something like 200 costs. Each cost is repeated for each department (A to E). What I would like to do is write a forumla that ranks the departments by the turnover percentage, but against each cost type. For example, the first cost type is Salaries, the 5 departments (A to E) are then ranked 1 - 5 based on the percentage column. However the cell references have to be fixed against the first entry which means when I drag this formula down =RANK(C1,$C$1:$C$5), the range doesn't move. Manually moving this formula down on the number of rows would take hours. Is there a way for it to calculate the rang only against each individual cost entry in column A.


    HTML Code: 


    Thanks again.

    I have included an attachment to make it clearer since Im not sure how to add the table

    AlexRanking Test.xlsx

  2. #2
    Registered User
    Join Date
    06-03-2013
    Location
    London, England
    MS-Off Ver
    Excel M365
    Posts
    73

    Re: How to Rank duplicated categories in a list

    Apologies that is showing as code I am not sure how to paste a table.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to Rank duplicated categories in a list

    With an pivot table.

    I made one in which you can choose the cost.

    You could also make severals pivot tables of the same data.

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How to Rank duplicated categories in a list

    I'm assuming that as you posted an xlsx file you are using a later version of Excel than your profile says, so try using this formula in D2 copied down to rank within each category

    =COUNTIFS(A:A,A2,C:C,">"&C2)+1

    ....or to ignore zero % values you can use this one

    =IF(C2=0,"",COUNTIFS(A:A,A2,C:C,">"&C2)+1)
    Last edited by daddylonglegs; 01-07-2015 at 04:43 PM.
    Audere est facere

  5. #5
    Registered User
    Join Date
    06-03-2013
    Location
    London, England
    MS-Off Ver
    Excel M365
    Posts
    73

    Re: How to Rank duplicated categories in a list

    Thanks both.

    I am hoping there might be a formula that I can use that looks to reset ever 24 rows or when the cost name changes. The reason is there are 100 cost types so I would like to avoid making 100 pivot tables, or having to drag it down 100 times resetting it each time since I will probably have to repeat this exercise with another set of data. I would also like to be able to 'averageif' the rank of each department on the entire data set at the end.

    Thanks

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to Rank duplicated categories in a list

    See in the attached file the new pivot table with all cost(centre) in the pivot table.

    Please reply.

  7. #7
    Registered User
    Join Date
    06-03-2013
    Location
    London, England
    MS-Off Ver
    Excel M365
    Posts
    73

    Re: How to Rank duplicated categories in a list

    Thanks, I see how you have the seperate sections for each cost however the rank column is not included. When I add this I am still not sure how I can then calculate the rank within each cost type?

    Say for temporary staff, then for overtime etc.

    Thanks

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to Rank duplicated categories in a list

    The data in my sheet are showed in the order of the rang.

    1) Why do you need the rank-number (it is a format issue)?

    2) you still use excel 2003, since it is not supported by Microsoft anymore?

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How to Rank duplicated categories in a list

    Quote Originally Posted by adambriggs View Post
    I am hoping there might be a formula that I can use that looks to reset ever 24 rows or when the cost name changes.
    My suggested formula doesn't change .......but it's only ranking within each cost name category, so you only need that single formula. If you put that formula in D2 and copy all the way down you will get the same ranks that you already have for the first cost type....and then a separate rank within each subsequent type.

+ 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] Rank with Sub-Categories and Tie-Breaks
    By KevinL54 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-24-2013, 02:15 AM
  2. Replies: 6
    Last Post: 03-26-2012, 05:12 PM
  3. Rank amounts and duplicated in descending order
    By jimstrongy in forum Excel General
    Replies: 3
    Last Post: 01-19-2012, 03:29 PM
  4. Using RANK base on 2 categories
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-09-2010, 07:12 PM
  5. getting duplicated values depending on rank order
    By zbor in forum Excel General
    Replies: 2
    Last Post: 05-28-2009, 03:28 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