Excel从一组选项中随机数 [英] Excel Random number from a set of options
本文介绍了Excel从一组选项中随机数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在MS Excel中,如何随机计算一组5个选项中的一个数字?
In MS Excel, how can I randomly calculate a number number that is from one of a set of 5 options?
例如,在单元格B1中,我想要一个随机数字是15,30,50,75或100.
For example, in cell B1 I would like to have a random number that is either 15,30,50,75, or 100.
我想在单元格B1:B100中完全随机输出这5个数字。
I would like a completely random output of these 5 numbers in cells B1:B100.
我以为可以使用rand在单元格A1中生成一个随机数,然后使用一系列>或< IF语句仅输出上述数字之一。
I was thinking that I could generate a random number in cell A1 using rand, then using a series of > or < IF statements to output only one of these numbers above.
推荐答案
此公式将执行以下操作:
This formula will do it:
=CHOOSE(RANDBETWEEN(1,5),15,30,50,75,100)
如果要使用一系列单元格:
If you want to use a range of cells:
=INDEX($B$2:$B$6,RANDBETWEEN(1,5))
这篇关于Excel从一组选项中随机数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文