
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?
Bookmarks