Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RANDARRAY with unique values

I have a list of unique words. I would like to populate some of them into a row range but every cell in the range would be filled in without duplicates.

=INDEX(A2:A120,UNIQUE(RANDARRAY(1,F1,1,ROWS(A2:A100),TRUE),TRUE))

so far I have this working formula, which provides the random unique values, however sometimes not all cells in the range filled in (because of the deleted duplicates). I saw solutions they use sequence to so solve this problem, but for mee it does not really work as it drops Calc! error.

=INDEX(A2:A120,UNIQUE(RANDARRAY(1,F1,1,ROWS(A2:A100),TRUE),TRUE), SEQUENCE(0,2))
like image 805
Tamas Kosa Avatar asked Mar 02 '26 00:03

Tamas Kosa


2 Answers

enter image description here

Formula in C1:

=TOROW(UNIQUE(SORTBY(A1:A10,RANDARRAY(ROWS(A1:A10)))))
like image 176
JvdV Avatar answered Mar 03 '26 14:03

JvdV


In this example formula takes 10 random values of 15 values existing unique list.

=TOROW(INDEX(A2:A16,TAKE(SORTBY(SEQUENCE(ROWS(A2:A16)),RANDARRAY(ROWS(A2:A16))),F1)))

Result:

enter image description here

like image 26
user11222393 Avatar answered Mar 03 '26 14:03

user11222393



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!