It looks to me like you want to create a column that computes the product of each combination/permutation. So, in many ways, this looks to me like a combination/permutation type problem (which I never do, so I'm not very good at programming them). My approach might look something like this (comma delimited):
product,Aindex,Bindex,Cindex,Avalue,Bvalue,Cvalue
=product(I2:K2),1,1,1,index(A1:A3,F2),copy of I2,copy of I2
copy of E2,1,1,2,copy of I2,copy of I2,copy of I2
...
The part that is left to figure out is what formulas to put in columns F, G, and H that will generate the permutations. In your example, you appeared to generate the permutations in lexicographic order, so if we can come up with a set of cell formulas that will recreate that logic, we should be able to do this. Maybe something like:
aindex,bindex,cindex
1,1,1
if(and(G2=3,H2=3),F2+1,F2),if(H2=3,G2+1,G2),=if(H2=3,1,H2+1)
copy of F2,copy of G2,copy of H2
...
though this might be tedious to extend to larger matrices.
In the spirit of brainstorming, would there possibly be a matrix function/multiplication that could represent this problem? If one could see a matrix representation of the problem, then we could possibly use one of the built in matrix functions (like MMULT()) to get at this.
Bookmarks