+ Reply to Thread
Results 1 to 8 of 8

How many pieces in a bar

  1. #1
    Registered User
    Join Date
    11-16-2018
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    27

    How many pieces in a bar

    Hello,

    Hope you are all keeping well, safe, healthy and happy during these crazy times!

    Hoping also for some help and thanking in advance anyone willing to lend a hand:

    How would I go about calculating how many bars of aluminum I need in order to fulfill an order that requires me to cut each bar into smaller pieces of a certain size?

    For example: If I get an order for 120 frames measuring 12" x 18", how do I calculate how many bars of aluminum (I buy them in a standard length of 160") I will need so I can order the right amount?

    For this particular example, I would need 2 cuts of each size (2 cuts of 18" and 2 cuts of 12") per frame (frames are rectangular and need 4 sides) … which means I would need to cut a total of 240 cuts of 18" each and 240 cuts of 12" each... how many bars would that be and how much material I would have left from each bar that I could potentially re-use for future orders?

    I have been searching online and I saw a reference to a Quotient formula to find out the number of cuts and a MOD formula to determine what is left... but I have been trying to no avail to make it work and I have not been able to figure it out. Maybe there is another way or maybe I am just doing it wrong.

    I would be very grateful if there was a way that I could input in a Column the width, in another column the length, in a third column the quantity and have the next 2 columns give me the answers of how many bars in total and how much waste per bar for this order.

    Thank you very, very much for any suggestions you may offer.

    Summer

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: How many pieces in a bar

    If I understand, you are talking about the cutting stock problem -- which is a surprisingly challenging programming problem. A few Excel specific tutorials

    http://blog.excelmasterseries.com/20...-with.html?m=1
    http://dailydoseofexcel.com/archives...stock-lengths/
    https://www.solver.com/cutting-stock
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    11-16-2018
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    27

    Re: How many pieces in a bar

    Oh wow... and here I was thinking the solution would be simple... holy cow!!

    Lots of reading to do... thank you!

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: How many pieces in a bar

    Perhaps a simple matrix as shown in the attached showing cuts and wastage % (based on 160" bar)


    =IF($B9*$A$2+H$1*$B$1<=$A$1,($A$1-($B9*$A$2+H$1*$B$1))/$A$1,"")
    Attached Files Attached Files
    Last edited by JohnTopley; 08-05-2021 at 02:24 AM.

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: How many pieces in a bar

    And a solver setup as well. I tested both excel solver and OpenSolver. No difference in the number of bars needed and total wastage. OpenSolver found a solution in a matter of
    seconds but excel solver oscillated for quite some time so I set a time limit of 10 second.

    I also assumed a rectangular frame so for 120 frames you would need 120*2 18" and the same number of 12" pieces. As the waste pr bar is 4" I don't think you need to consider cut
    thickness or?

    the biggest difference between OpenSolver and Excel solver is that OpenSolver only uses 2 cutting pattern as opposed to excel that uses 4 different cutting pattern.

    Alf
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-16-2018
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    27

    Re: How many pieces in a bar

    Thank you SOOOO much!!! This is fantastic!! I will test the solutions but I am sure they will work great. You guys rock!!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: How many pieces in a bar

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Registered User
    Join Date
    11-16-2018
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    27

    Re: How many pieces in a bar

    I was not aware of the reputation star but now I am and it is done. Thank you!!!

    As soon as I test the solutions I will mark as solved.

    Thank you again!

+ 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. Insert row pieces
    By std51 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-11-2016, 12:27 PM
  2. Combining Two Pieces of Code
    By nickhunt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2014, 02:58 AM
  3. Looking up several pieces of data
    By darylpaskell in forum Excel General
    Replies: 0
    Last Post: 10-16-2013, 11:50 AM
  4. [SOLVED] Looking up a value based on two pieces of information
    By jshaw82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-11-2013, 03:48 PM
  5. Parsing into three pieces
    By Viewson in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-26-2011, 06:18 AM
  6. Extracting pieces of a cell?
    By XLevel in forum Excel General
    Replies: 2
    Last Post: 01-30-2009, 09:47 PM
  7. Hash (#) Key and other function pieces
    By Damask in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2006, 07:23 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