Making Sets of 3 from a List

GetSmart

New Member
Joined
Sep 1, 2007
Messages
6
Hi,

I posted this on another Excel Help forum but have not found a working solution yet. I was wondering if anyone here could shed some light on code complexity:

http://www.excelforum.com/showpost.php?p=1822310&postcount=3

Possible code logic might be something like this:
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.

How much of a programming job would this be? I'm not knowledgeable enough in VBA to write the code myself...thanks!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,215,832
Messages
6,127,150
Members
449,366
Latest member
reidel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top