ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is it possible to permutate in Excel (https://www.excelbanter.com/excel-programming/280457-possible-permutate-excel.html)

Henrik[_2_]

Is it possible to permutate in Excel
 
Is it possible to permutate three arrays of numbers in
Excel?

For instance:

Array 1: [a,b,c,d]
Array 2: [A,B,C,D]
Array 3: [1,2,3,4]

I want to solve for every singe combination of Array 1 *
Array 2 * Array 3 (a*A*1, a*A*2, a*A*3, etc.). Is it
possible to automate this process by writing a macro or VB
Script or by another method? Your help is very much
appreciated.




Tom Ogilvy

Is it possible to permutate in Excel
 
I am guessing this is what you want

Sub Combos()
arr1 = Array("a", "b", "c", "d")
arr2 = Array("A", "B", "C", "D")
arr3 = Array("1", "2", "3", "4")
rw = 1
For i = LBound(arr1) To UBound(arr1)
For j = LBound(arr2) To UBound(arr2)
For k = LBound(arr3) To UBound(arr3)
Cells(rw, 1) = arr1(i) & "*" & _
arr2(j) & "*" & arr3(k)
rw = rw + 1
Next: Next: Next
End Sub


--
Regards,
Tom Ogilvy


Henrik wrote in message
...
Is it possible to permutate three arrays of numbers in
Excel?

For instance:

Array 1: [a,b,c,d]
Array 2: [A,B,C,D]
Array 3: [1,2,3,4]

I want to solve for every singe combination of Array 1 *
Array 2 * Array 3 (a*A*1, a*A*2, a*A*3, etc.). Is it
possible to automate this process by writing a macro or VB
Script or by another method? Your help is very much
appreciated.







All times are GMT +1. The time now is 07:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com