+ Reply to Thread
Results 1 to 16 of 16

Sort and Group orders by capacity.

  1. #1
    Registered User
    Join Date
    12-04-2019
    Location
    canada
    MS-Off Ver
    professionnal plus 2016
    Posts
    8

    Question Sort and Group orders by capacity.

    Hello,
    I would like to sort my excel sheet
    in this exemple, i need to group them as a max capacity of 80 per day and a max of 10 orders per day.

    i know that with this small exemple it is easy to manually do it. but i'm looking forward to do this on a couple thousand orders.

    Thanks,

    David
    Attached Files Attached Files

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Sort and Group orders by capacity.

    I think that you can do with with the Solver add in - please see the attachment.

    You can calculate a minimum number of days by dividing you total order sizes by 80 - this gives 7 in this case.

    Use formula like in the sheet for days 1 to 7.

    I've included an image of the solver constraints. The sheet has a 7 day solution to the sample data.
    Attached Files Attached Files
    Martin

  3. #3
    Registered User
    Join Date
    12-04-2019
    Location
    canada
    MS-Off Ver
    professionnal plus 2016
    Posts
    8

    Re: Sort and Group orders by capacity.

    Thanks alot.
    I'm trying this at the moment,

    Although, the solver don't let me add the integer constraints. (also what does it do?)

    thanks
    David

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Sort and Group orders by capacity.

    Int is one of the options for the constraints if you scroll down.

    Solver is basically trying lots of options to find one that fits.

  5. #5
    Registered User
    Join Date
    12-04-2019
    Location
    canada
    MS-Off Ver
    professionnal plus 2016
    Posts
    8

    Re: Sort and Group orders by capacity.

    Now i get a box saying: too many variable cells.

    David

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Sort and Group orders by capacity.

    Ok - maybe you are working on a larger data set that the one supplied?

  7. #7
    Registered User
    Join Date
    12-04-2019
    Location
    canada
    MS-Off Ver
    professionnal plus 2016
    Posts
    8

    Re: Sort and Group orders by capacity.

    Yes, this was only an exemple of what i want to accomplish.
    i wish to integrate this on a scale of about 4000 to 10000 orders. with a date range of 253 days.

    David

  8. #8
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Sort and Group orders by capacity.

    Do earlier orders take precedence over later orders?

    I'm thinking that you might need some sort of 'greedy' algorithm which picks orders one day at a time and aims to prefer the biggest and smallest so that the two maxima are not exceeded. Once it finishes with one day it starts with the next. Do you intend to run this one a day to pick just the next days work?

  9. #9
    Registered User
    Join Date
    12-04-2019
    Location
    canada
    MS-Off Ver
    professionnal plus 2016
    Posts
    8

    Re: Sort and Group orders by capacity.

    This scheduling process would be only use 2-3 time max per year.
    all orders are already in "bank" since they are not really orders.
    lets see it like warehouses.
    i know how many warehouse (orders) I can move per day (10) even if it has only 1 item in it
    I know that depending on how many item there is in one warehouse it take more time so max (80)

    of course ill be adding some special add on this but if i can get this going ill be able to set everything else.

    david

  10. #10
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Sort and Group orders by capacity.

    Hmmm... Getting late here - I'll think about it....

  11. #11
    Registered User
    Join Date
    12-04-2019
    Location
    canada
    MS-Off Ver
    professionnal plus 2016
    Posts
    8

    Re: Sort and Group orders by capacity.

    Thanks,

    David

  12. #12
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Sort and Group orders by capacity.

    There might be an approach which is based upon the factors of 80.

    First, pick all orders with size 80.
    Then pairs of orders of 40
    Then groups of 4 orders of 20
    Then groups of 5 orders of 16

    Then pairs of orders which total 80
    Then pairs of orders which total 40
    Then pairs of orders which total 20
    Then pairs of orders which total 16

    Then groups of three orders which total 20 (40 and 80 have lots of combinations)
    Then groups of three orders which total 16

    What's left might be addressed by the solver approach or left as a start for the next run.

  13. #13
    Registered User
    Join Date
    12-04-2019
    Location
    canada
    MS-Off Ver
    professionnal plus 2016
    Posts
    8

    Re: Sort and Group orders by capacity.

    Well, this is basically what I am currently doing right now.

    But doing so with all lines, take way to much time.

    The numbers I mention are only for example purpose.

    The max number of item per day I can do is 500. but on my database here i have 4000 line of "orders" and there is about 3800 lines that have less than 100 items.

    This is why i need something to automate the process.

    David.

  14. #14
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Sort and Group orders by capacity.

    This is automatable. I can try to but something together - what is the maximum size of an order and what is the real maximum number of orders per day?

  15. #15
    Registered User
    Join Date
    12-04-2019
    Location
    canada
    MS-Off Ver
    professionnal plus 2016
    Posts
    8

    Re: Sort and Group orders by capacity.

    Maximum items in one order is 1467. but i can manually place all orders over 300 (there is 7)
    the max number of orders per day is 50
    The max number of items per day is 350

    thanks
    David

  16. #16
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Sort and Group orders by capacity.

    Please have a look at the attached file.

    I've gone for an approach were the min and max daily size is specified and random combinations are tried to see it they meet the criteria.

    It's not a fast piece of code so it is best left for a while to crunch through the possibilities.
    Attached Files Attached Files

+ 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. Using custom sort orders with Range().sort
    By WestWindsDemon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2018, 03:52 PM
  2. [SOLVED] Different Fruit allocated numbers, group the orders
    By slxia1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-30-2014, 06:07 PM
  3. Replies: 1
    Last Post: 04-18-2014, 05:54 PM
  4. Sort rows based on open or closed orders.
    By mralph in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2013, 12:50 PM
  5. Shortcuts to different sort orders?
    By Carson Dyle in forum Excel General
    Replies: 3
    Last Post: 05-05-2013, 01:24 AM
  6. How to group orders and order items?
    By madsylar in forum Excel General
    Replies: 1
    Last Post: 03-24-2011, 12:45 AM
  7. Automatically maintaining sort orders
    By scaffdog845 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2009, 03:39 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