Combinations from Multiple lists

aygith

New Member
Joined
Apr 1, 2016
Messages
3
Hello,

I apologise upfront if this is extremely confusing - i have struggled to put it into a nice clear format! however...

I have 4 lists of data with each row containing two values;

[TABLE="class: grid, width: 982"]
<tbody>[TR]
[TD]Table 1[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[TD][/TD]
[TD]Table 2[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[TD][/TD]
[TD]Table 3[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[TD][/TD]
[TD]Table 4[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[/TR]
[TR]
[TD]First[/TD]
[TD="align: right"]52.3[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD]First[/TD]
[TD="align: right"]38.4[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD]First[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]46.5[/TD]
[TD][/TD]
[TD]First[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]43.5[/TD]
[/TR]
[TR]
[TD]Second[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]48.8[/TD]
[TD][/TD]
[TD]Second[/TD]
[TD="align: right"]24.6[/TD]
[TD="align: right"]17.2[/TD]
[TD][/TD]
[TD]Second[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]30[/TD]
[TD][/TD]
[TD]Second[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]24.4[/TD]
[/TR]
[TR]
[TD]Third[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]48.9[/TD]
[TD][/TD]
[TD]Third[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]31[/TD]
[TD][/TD]
[TD]Third[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]15[/TD]
[TD][/TD]
[TD]Third[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Fourth[/TD]
[TD="align: right"]29.4[/TD]
[TD="align: right"]42.6[/TD]
[TD][/TD]
[TD]Fourth[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]28.3[/TD]
[TD][/TD]
[TD]Fourth[/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD]Fourth[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]11[/TD]
[/TR]
</tbody>[/TABLE]

Each list/table could contain between 1 and 20 rows of data.

What i need is something that can take 1 row from each group of data (table1 ,2 ,3 ,4) add up the val 1 and val 2 for each item resulting in two totals per 4 rows combined.
For instance
Table 1 - Fourth 29.4/42.6
Table 2 - Second 24.6/17.2
Table 3 - Third 17/15
Table 4 - Fourth 17/11
Val1 = 88
Val2 = 85.8
However i would want it to do this for every combination possible.

That's the basic version of it as a bare minimum...

The more advanced version would be the above, however it attempt to get as close to val1=90 and val2=90 as possible using all 4 items, then moves to the next set - not allowing re-use of the data used in any previous matches. Thus 'set' 2 could not contain T1-Fourth, T2-Second, T3-Third or T4 - Fourth

Thus from the above tables i would have the best 4 combinations to bring me as close to 90/90 as possible for each output. Expected result would be set 1 = closest to 90/90, set 2 = slightly less and so on, with the last being the furthest from 90/90 due to only having the left overs to work with.

Thanks for your time, hopefully the above makes sense to somebody!
 
Hello,

I apologise upfront if this is extremely confusing - i have struggled to put it into a nice clear format! however...

I have 4 lists of data with each row containing two values;

[TABLE="class: grid, width: 982"]
<tbody>[TR]
[TD]Table 1[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[TD][/TD]
[TD]Table 2[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[TD][/TD]
[TD]Table 3[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[TD][/TD]
[TD]Table 4[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[/TR]
[TR]
[TD]First[/TD]
[TD="align: right"]52.3[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD]First[/TD]
[TD="align: right"]38.4[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD]First[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]46.5[/TD]
[TD][/TD]
[TD]First[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]43.5[/TD]
[/TR]
[TR]
[TD]Second[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]48.8[/TD]
[TD][/TD]
[TD]Second[/TD]
[TD="align: right"]24.6[/TD]
[TD="align: right"]17.2[/TD]
[TD][/TD]
[TD]Second[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]30[/TD]
[TD][/TD]
[TD]Second[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]24.4[/TD]
[/TR]
[TR]
[TD]Third[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]48.9[/TD]
[TD][/TD]
[TD]Third[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]31[/TD]
[TD][/TD]
[TD]Third[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]15[/TD]
[TD][/TD]
[TD]Third[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Fourth[/TD]
[TD="align: right"]29.4[/TD]
[TD="align: right"]42.6[/TD]
[TD][/TD]
[TD]Fourth[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]28.3[/TD]
[TD][/TD]
[TD]Fourth[/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD]Fourth[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]11[/TD]
[/TR]
</tbody>[/TABLE]

Each list/table could contain between 1 and 20 rows of data.

What i need is something that can take 1 row from each group of data (table1 ,2 ,3 ,4) add up the val 1 and val 2 for each item resulting in two totals per 4 rows combined.
For instance
Table 1 - Fourth 29.4/42.6
Table 2 - Second 24.6/17.2
Table 3 - Third 17/15
Table 4 - Fourth 17/11
Val1 = 88
Val2 = 85.8
However i would want it to do this for every combination possible.

That's the basic version of it as a bare minimum...

The more advanced version would be the above, however it attempt to get as close to val1=90 and val2=90 as possible using all 4 items, then moves to the next set - not allowing re-use of the data used in any previous matches. Thus 'set' 2 could not contain T1-Fourth, T2-Second, T3-Third or T4 - Fourth

Thus from the above tables i would have the best 4 combinations to bring me as close to 90/90 as possible for each output. Expected result would be set 1 = closest to 90/90, set 2 = slightly less and so on, with the last being the furthest from 90/90 due to only having the left overs to work with.

Thanks for your time, hopefully the above makes sense to somebody!

bump :(
 
Upvote 0

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