统计了各个地区各个公司的人员情况,下面要从中抽取一人,做为幸运观众,给以物质奖励。当然也不能有猫腻,不然会引起不服,这里我们就要用到rand随机函数了,以下是我做的一个抽奖模拟系统。
实例教程
①打开Excel,参与抽奖的人员名单已经制作好了,我们直接在F2单元格输入:=INDIRECT("d"&INT(RAND()*13+2))

②公式的意义我稍后为大家说明,回车按下,得到一个人员的名字:黄博文。

③选中A:D列,单击菜单栏--条件格式--新建规则选项。

④选择最后一个规则类型,使用公式确定要设置格式的单元格,输入公式:=$D1=$F$2,点击格式按钮。

⑤设置单元格格式,也就是中奖人员在名单册中的现实方式,与其他人进行区分。

⑥完毕,做为恒大勇夺亚冠冠军的一员,黄博文中奖。我们按下F9键刷新,就会重新抽奖。

公式说明
int函数返回一个2-14的随机整数,和d串联就会返回D2:D14之间的随机单元格,最后,indirect会返回随机单元格里面的姓名。