Excel从数组中选择一个值

时间:2015-04-03 18:05:53

标签: excel

Excel中是否有公式从值列表中选择随机值?例如,我希望单元格从"Yes, No, Maybe".

中随机选择其值
Answer
Yes
No
Maybe
Yes

1 个答案:

答案 0 :(得分:4)

考虑:

=CHOOSE(RANDBETWEEN(1,3),"Yes","No","Maybe")

修改#1:

结果的分布可以“加权”(直到某一点)。考虑:

=CHOOSE(RANDBETWEEN(1,4),"Yes","Yes","No","Maybe")

这会产生两次 没有可能的 p>

这有点粗糙..............另请注意, CHOOSE()可以处理多少项的限制!