简体   繁体   English

根据单元格值随机选择一个范围内的多个单元格

[英]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. 我想选择一个范围(C7:M37)内的单元格,但是该范围内的某些单元格是空的,不应选择。 In addition, the number is base on an equation (R41) so the number of select cells would be different each time. 另外,该数目基于方程式(R41),因此每次选择单元的数目将不同。 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="" . 但是,如果您想忽略空单元格,则需要更多的信息来确定..否则它将只是一个简单的嵌套if =“”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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