+ Reply to Thread
Results 1 to 7 of 7

Ranking by category

  1. #1
    Registered User
    Join Date
    02-06-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Ranking by category

    Sorry for the long-winded title. I work in the grocery retail industry and have a list of items across different categories. I am looking to find out how many categories have a Private Label item ranked first or second in terms of sales. The problem is that a simple rank function doesn't work because there is one category column with many categories listed throughout. So in the "Rank" column, I wouldn't want an item's rank amongst all items in the list but instead its rank among all items with the same value for "Category" (ie a pasta sauce item's rank among only the pasta sauce items).

    Any help would be greatly appreciated.

  2. #2
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Ranking by category

    G'day bigmurn and welcome to Excel forum,

    Please supply a outlay of the data you have to work with. I have an idea but it may not work with the data layout you have to work with. I take that this grocery information is been imported from your back office retail system ?

    Remember do not upload any information that we shouldn't know.

    Cheers

    RC
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

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

    Re: Ranking by category

    If you have categories in A2:A100 and "scores" in B2:B100 then this formula in C2 copied down will rank by score (highest = 1) in each category.

    =SUMPRODUCT((A$2:A$100=A2)*(B$2:B$100>B2))+1

    adjust ranges as required

  4. #4
    Registered User
    Join Date
    02-06-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Ranking by category

    Attached is a an example with fake data. Can you see if this will work?

    Thanks a ton.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Ranking by category

    So if we take DaddyLongs formula and applied to the example sheet it looks like this

    Place any of these formulas in F2 and copy down

    Please Login or Register  to view this content.

    If you wish to filter out the other rankings and just see the Private Labels ranking try this

    Please Login or Register  to view this content.

    Or just see only rankings of #1 and/or #2 try this

    Please Login or Register  to view this content.

    Side note: Daddylongs solution is a lot cleaner . I think I would have needed a building permit compare to my solution

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Ranking by category

    Given use of 2007 I wonder if perhaps you could revert to using COUNTIFS / SUMIFS etc...?

    Please Login or Register  to view this content.

    You could also conduct a SUMIFS to track the Sum of Rank for Private Labels

    Please Login or Register  to view this content.

    Your count of Private items occupying Ranks 1 & 2 is then a basic COUNTIF (/2) assuming of course you have 2 Private Labels per category...

    Please Login or Register  to view this content.

    If that's not the case let us know.

  7. #7
    Registered User
    Join Date
    11-20-2012
    Location
    a
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Ranking by category

    Hi, I just found this post and it helped me a lot, so thank you very much. However, I would like if you could help me one step further. Just trying to help anyone who see this from google, like me : if you want to use this in a table, here is the rough formula :

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Also, something that was very helpful for me : you can have subcategories too. let's say you want to rank per column 2 inside of the category of column 1, for the sales which are in column 3.

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    I hope this makes sense as English is not my first language and this is my first post so the syntax may be way off.

+ 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