I will need to digest the Spread Sheet but that helps a lot. Still trying to visualize. A couple of notes.
1) There is a ton of software out there for commercial and hobbyists that does stock cut optimization. I was kind of suprised about how much there is. Most seem to be in the 160-180 range.
Here is one and you can demo the free version. It is too limited for your use because you can only do 100 total cuts
However instead of doing 400 boxes I ran it doing 20 boxes for your first example. And it gives you this mix
4 @ 442,442,442,442,442,142 waste 88
1 @ 142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142 waste 168
It actually provides this information in a table that could then get input into access for tracking of orders. I am not advocating anything since there are lots of others, but the freeware was user freindly and has lots of options.
You may want to look for other freeware as well. Google "Stock Cut optimizer, Cutting Stock, 1d Stock Cutting, 2d Stock Cutting, etc.
2) Most software handles a 1d problem or a 2d problem. A 1D problem is like ordering rebar where you are cutting a bar to specific lengths. The only concern in the pattern is which lengths to cut. The 2D problems are like in a glass/mirror shop where you are cutting patterns out of a sheet. 3D would be like cutting shapes out of foam blocks.
3) If I understand your problem it may be a hybrid of a 2d and 1d adding some complexity. 2D in that you are picking a combination of strip sizes and 1D in the cutting of the strips. (It appears you are currently not doing that, but if you mixed orders where you have different widths of strips).
4)Most solutions and algorithms (both theoretical and practical) start with defining all feasible patterns. A feasible pattern is one where the amount of leftover is smaller then the samallest piece required to cut. A lot of generic optimizers like Excel require you have to figure this out in order to formulate the problem. That could be pretty complicated by itself. So if I was doing this using Excel I would write the code to have a basic input screen and then it would formulate the problem by enumerating the feasible patterns. Obviously the dedicated software does this for you. The algorithms then minimizes the waste by figuring out the correct combination of feasible patterns.
In order to visualize how you do this I will asks questions on the first order
LENGTH WIDTH HEIGHT #boxes
420 120 85 440
1)It appears that strips are cut from a board of 2440 X 1220?
(or an 8'X4' sheet of plywood/laminate)
2)You show strip widths of 100 and 147. Where does that come from?
Is 100, 85 for the box ht plus some buffer. Is 147 for the base and top the width of the box plus some overlap?
3) I assume the strips are ripped like this
long way (giving you strips that are 100/147 wide by 2440 long)
1220
___________
| | | |
| | | |
| | | |
| | | |
| | | | 2440
| | | |
| | | |
| | | |
| | | |
-----------
4)The sides, base and lid are all cut from seperate stock and not interchangeable due to different thickness of stock? That appears to simplify things a whole lot. If that is the case then you are only optimizing the sides. It is a 1D problem. Only trying to determine the mix of long and short sides on a pattern.
All tops (or bottoms) get cut out of their own piece of stock. you do not have a lot of choices (unless you can mix with a later order). You have to rip enough strips to make your tops and your stuck with whatever waste you have after cutting.
I was originally thinking that tops, bottoms, and sides all could be cut from the same stock, and you could mix orders. That would be orders of magnitude more complicated.
5)How is strip cut size determined? I am assuming you start with a strip of 2440 (or 1220 depending on direction you rip) and then cut it down. But in the first example the long side is cut to 442
and you get 5. Is 442 some buffer to get a finished side of 420?
6) That then leads another question. If you are cutting 5@442 would you have a blade loss of something like 5 X .25? Thus something less than 230 for your waste.
I will keep looking for a free way to do this. Building your own algorithm may be tough, but I will see what I can do.
7) With that said do you really need to do this in Access? What data is saved/stored. Could you use an application like 1D Stock Optimizer then save the data into Acess.