+ Reply to Thread
Results 1 to 7 of 7

Sorting based on count...

  1. #1
    Registered User
    Join Date
    01-11-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    14

    Sorting based on count...

    I have a spreadsheet which lists all of our company's outstanding order lines - currently sitting at about 30,000 lines. (We have a catalogue of about 1 million items). The catalogue number is the unique property for each product.

    I'd like to be able to sort them so that the items with the most outstanding orders are listed at the top of the report. I think this means counting how many times each catalogue number appears, and then sorting this count from largest to smallest.

    My aim is to see which items have the most outstanding orders, so that I can see where we have the biggest stock shortages, and can then act accordingly.

    Should I be sub-totalling the catalogue numbers as a starting point?

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Sorting based on count...

    with order numbers in col a first sort sheet by col a to get the orders together then in another column put =countif(a:a,a1) and drag down then sort sheet descending by that column
    Last edited by martindwilson; 02-16-2010 at 08:36 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    01-11-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Sorting based on count...

    Quote Originally Posted by martindwilson View Post
    with order numbers in col a first sort sheet by col a to get the orders together then in another column put =countif(a:a,a1) and drag down then sort sheet descending by that column
    Thanks for your reply.

    Am unclear what the a:a represents in your formula.
    A1 is presumably the cell with the unique item catalogue number.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Sorting based on count...

    Yep so drag that down and every thing will be counted A:A is the whole column you could use
    a1:a30000 or whatever your range is

  5. #5
    Registered User
    Join Date
    01-11-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Sorting based on count...

    Quote Originally Posted by martindwilson View Post
    Yep so drag that down and every thing will be counted A:A is the whole column you could use
    a1:a30000 or whatever your range is
    Yep, got it and works well - thanks...


    I'd like to take it to the next level - and use the info to provide me with a list of the items with the biggest orders (largest to smallest).

    If I have (say) 500 orders for a particular item, it lists all 500 individual order lines (which I suppose is what I asked for previously).. I'd like to see some sort of summary list with only one line per item..

    eg:

    Product A - 500
    Product B - 450
    Product C - 300
    ..and so on..

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Sorting based on count...

    run a pivot table report
    just using product codes as source
    in the table drag the field into row and data sections
    youll get a pivot table with 2 columns
    you can sort the pivot table
    highlight all the total values
    then sort descending as you would any column

  7. #7
    Registered User
    Join Date
    01-11-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Sorting based on count...

    Thanks martindwilson - works a treat.

+ 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