Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choosing a random text value from a list

I have an Excel spreadsheet like this:

Checkbox Value
FALSE Value1
TRUE Value2
TRUE Value3
FALSE Value4

I want to create a list with FALSE values and choose a random text value from that list. For choosing random text value I tried using CHOOSE(RANDBETWEEN()) I tried to use IF(NOT(Checkbox), Value, "") but it gives empty cells, and I do not want that.

like image 358
Şafak Avatar asked Jan 19 '26 00:01

Şafak


2 Answers

With Microaoft-365, give a try to-

=CHOOSEROWS(FILTER(B2:B100,A2:A100=FALSE),RANDBETWEEN(1,COUNTIFS(A2:A100,FALSE)))

enter image description here

like image 164
Harun24hr Avatar answered Jan 21 '26 06:01

Harun24hr


How about:

=@SORTBY(B2:B5,A2:A5-RANDARRAY(ROWS(B2:B5)))

If it's possible that A2:A5 doesn't comprise a single FALSE entry, as per the comments from @Domenic:

=IF(AND(A2:A5),"",@SORTBY(B2:B5,A2:A5-RANDARRAY(ROWS(B2:B5))))

like image 27
Jos Woolley Avatar answered Jan 21 '26 05:01

Jos Woolley