Here's a way to generate the combinations from column data ..
Assume a source of 3 variables per col within 6 cols in Sheet1's A1:F3, viz:
1 10 21 34 40 11
3 14 23 37 42 13
4 17 28 38 43 18
(all 18 numbers are assumed unique)
and we want to "generate" the above into a total of:
3^6 = 729 combinations in a final output Sheet4, ie:
1-10-21-34-40-11 (< in A1)
1-10-21-34-40-13
1-10-21-34-40-18
....
....
4-17-28-38-43-11
4-17-28-38-43-13
4-17-28-38-43-18 (< in A729)
Steps:
In Sheet2
-------------
Put in:
A1: =OFFSET(Sheet1!$A$1,INT((ROW(A1)-1)/3),)
B1: =OFFSET(Sheet1!$B$1,MOD(ROW(A1)-1,3),)
C1: =OFFSET(Sheet1!$C$1,INT((ROW(A1)-1)/3),)
D1: =OFFSET(Sheet1!$D$1,MOD(ROW(A1)-1,3),)
E1: =OFFSET(Sheet1!$E$1,INT((ROW(A1)-1)/3),)
F1: =OFFSET(Sheet1!$F$1,MOD(ROW(A1)-1,3),)
Select A1:F1, copy down to F9
In Sheet3
-------------
Put in A1
=OFFSET(Sheet2!$A$1,INT((ROW(A1)-1)/9),)&"-"&OFFSET(Sheet2!$B$1,INT((ROW(A1)-1)/9),)
Put in B1
=OFFSET(Sheet2!$C$1,MOD(ROW(A1)-1,9),)&"-"&OFFSET(Sheet2!$C$1,MOD(ROW(A1)-1,9),1)
Put in C1
=OFFSET(Sheet2!$E$1,MOD(ROW(A1)-1,9),)&"-"&OFFSET(Sheet2!$E$1,MOD(ROW(A1)-1,9),1)
Select A1:C1, copy down to C81
In Sheet4
------------
Put in A1
=OFFSET(Sheet3!$A$1,INT((ROW(A1)-1)/9),)&"-"&OFFSET(Sheet3!$B$1,INT((ROW(A1)-1)/9),)&"-"&OFFSET(Sheet3!$C$1,MOD(ROW(A1)-1,9),)
Copy A1 down to A729. This will list all 729 (3^6) combinations from the
source data in Sheet1's A1:F3.
Adapt to suit .. The method limits a max extension for the source data
to 6 var per col in 6 cols (in Sheet1's A1:F6) which'll generate 6^6 = 46656
combinations in Sheet4 (as 7^6 = 117649, which exceeds Excel's max 65536
rows).
---
Hey guys thanks for the quick response....I tryied both recomondations
and both were able to compare the data i needed. However how can i get
excel to return each possible comparison i.e
1 & 5, 1 & 6, 1 & 7, 2 & 5, 2 & 6, 2 & 7, 3 & 5, 3 & 6, 3 &
7, from the two rages of 1,2,3 and the second of 5,6,7 ??
Ultimatly the end result would be a list of all the possible
combonations.
Orig. post: