简体   繁体   中英

Randomly select a number multiple cells within a range based a cell value

I would like to select a number of cells within a range (C7:M37), but some of the cells in that range are empty and should not be picked. In addition, the number is base on an equation (R41) so the number of select cells would be different each time. Is that possible? Thanks!

If you just use all cells it'll be :

=INDEX(C7:M37,RANDBETWEEN(1,ROWS(C7:M37)),RANDBETWEEN(1,COLUMNS(C7:M37)))

but if you want to ignore the empty cell .. need more info to be firm.. else it'll be a just a simple nested if="" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM