In Excel, re-arrange a sequence N times randomly

Column A is a random sequence. Cell B2 contains the parameter that represents the number of times of re-arranging members of the sequence.


A

B

1

Items

Replicates

2

A

2

3

B


4

C


5

D


We need to rearrange column A N times.


D

1

Result

2

C

3

D

4

B

5

A

6

D

7

A

8

B

9

C

Use SPL XLL to enter the formula below:

=spl("=?2.conj(?1.sort(rand()))",A2:A5,B2)

Picture1png

"integer.()" represents looping N times. conj() function concatenates multiple sequences. sort(rand())sorts a sequence randomly.

Source:https://stackoverflow.com/questions/78272950/create-n-random-lists-from-initial-set-of-values-in-excel