14.11 Generate permutations and combinations

 

Here below is a data table, in which the data are separated by commas:

imagepng

Now we want to list the permutations and combinations of these data, one combination per row, as shown in the following figure:

imagepng

Enter in cell A2:

A
1 =‘A1:C1’.conj().(~.split@c())
2 =A1.(“A1(”/#/“)”).concat(“;”)
3 =xjoin(${A2})

A1: Split the data in each cell with comma, and the option @c means splitting with comma
A2: Loop through each member of A1 and concatenate them into a string A1(1);A1(2);A1(3)
A3: Convert the string concatenated in A2 to the parameter of the function xjoin in macro form, that is, perform full cross-product on the sequences formed by split data in each cell


esProc Desktop and Excel Processing
14.10 Expand into multiple N-column horizontally
15.1 Split string - separate by comma – automatic parsing of data type