+ Reply to Thread
Results 1 to 10 of 10

PROBLEM - how many cartons fit in that box

  1. #1
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    PROBLEM - how many cartons fit in that box

    I've been trying to work a formula but looking online I think it may be a bit more complex!

    I have a carton a particular size eg 9cm x 9cm x 22cm- I want to know how many go into a space 60cm x 40cm x 30cm.

    there seems to many pallet solutions in software- but not for cartons into a larger space- the fit can leave space but rather than sitting drawing it out- which is what Im doing! is there a solution that can work this out- then present the solution somehow???

    just a thought may be a macro solution!!

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

    Re: PROBLEM - how many cartons fit in that box

    Try this user defined function

    Please Login or Register  to view this content.
    Open the VBA editor by hitting Alt F11.
    Insert a new module with Insert - Module
    Paste in the above function
    Go back to the sheet by hitting Alt F11.

    A1 = 9, B1 = 9, C1 = 22 D1 = 60 E1 = 40 F1 = 30


    In G1, enter = Fit(A1,B1,C1,D1,E1,F1)

    Remember to save the workbook as a macro enabled workbook .xlsm

    I've assumed that the orientation of the cartons in the box is not important.
    Martin

  3. #3
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: PROBLEM - how many cartons fit in that box

    this works foer the same layers but take the shape 10cm x 9cm x 22.5

    logic suggests 4 x 10cm on the 40cm side - 2 x 22.5cm on the 60cm side-leaving ( 60cm - 45cm =15cm)

    three layer so of 9cm = 24

    the formula doesnt take into account toe 15cm wide by 40cm x 30cm gap at one end - where I get 3 more of the size fitting in.....

    not sure this is doable in excel - what do you think

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

    Re: PROBLEM - how many cartons fit in that box

    Probably needs a recursive solution - will think about it.

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

    Re: PROBLEM - how many cartons fit in that box

    Try this

    Please Login or Register  to view this content.
    The function predicts that you can get 30 cartons into the box (I would need a box and a set of cartons to convince myself). It works by finding the maximum number in a single cuboid and then repeats the exercise to find the maximum for the cuboid portions of the space that is left.

    With the largest face as the horizontal base, have a 6 layers of 3 cartons with 60 aligned with 9, and 22 aligned with 40. This leaves a cuboid space of width 60, depth 18 and height 30. This is filled with a single layer of 12 cartons with the square face horizontal.

  6. #6
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: PROBLEM - how many cartons fit in that box

    sorry now just get a #value error

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

    Re: PROBLEM - how many cartons fit in that box

    Sorry - function now needs an extra parameter

    In G1, enter = Fit(A1,B1,C1,D1,E1,F1,0)

  8. #8
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: PROBLEM - how many cartons fit in that box

    Im going barmey- that works great except when i re-open the macro enabled workbook I get the #value error in G1 ( the fit function is in the module ) - or if I over type a value in A1 to F1????

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

    Re: PROBLEM - how many cartons fit in that box

    Are macros enabled when you open it?

  10. #10
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: PROBLEM - how many cartons fit in that box

    Hi all figured cheers

    me being a numpty

+ 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. input box problem, cell filtering problem, result display while locking sheet
    By croozin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2013, 08:52 AM
  2. Replies: 6
    Last Post: 05-28-2013, 05:08 PM
  3. Auto Calculate Shipping Weight/Cartons and Package Weight.
    By suhailsiddiqui09 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-27-2013, 06:48 AM
  4. Replies: 0
    Last Post: 06-18-2012, 06:35 AM
  5. Replies: 9
    Last Post: 12-06-2007, 11:29 AM

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