Quote Originally Posted by xlwho
Thanks for the reply...instead of considering all possible combinations of matched sets, I guess we're looking at some kind of VB script that:

1. Starts at the first row of the sorted input table and stores the flow and length values in temporary variables
2. Proceeds to the next row of the sorted table and stores the flow and length values in a second set of variables.
3. Proceeds to the next row and stores a third set of variables.
4. Performs a calculation on the stored variables to determine if the sum of the flows falls within the necessary range.
5. If so, populate the first row in the output table with the results and delete the three rows from the input table and resort.
6. If not, replace the third input row with the next available input row and recalculate. Continue looping through the subsequent rows until a set can be made. This might require nested loops because if no acceptable third variable makes a matched set, the second and then the first input rows would have to be increase by 1 (while also making sure that row is not already being used in the variable set) each time the loop runs without a successful "hit" meeting the conditions.
7. Repeat until no additional matched sets are found.

Would this yield the least waste? If so, what would the script look like? If not, how could it be optimized?
Your suggested algorithm can be incorporated in a macro with nested loops but it will not ensure minimum waste. For that we will have to use some more complex mathematial methods I don't much about.
Just to confirm what I understand the problem can I say that you have a number of rectangular pieces and you want to make bigger rectangular pieces by joing three pieces together and the new assemblies will have width between 140 and 180 and length as much as possible ( I will have to cut two pieces in length so that they match the length of the shortes in the group).
It sounds very interesting but seems complex. Let me think this over.

A V Veerkar