表格范围内产生随机数_如何在Google表格中生成随机数

表格范围内产生随机数

表格范围内产生随机数

Sheets Header

Google Sheets provides a simple function to generate random numbers inside your spreadsheet without having to leave the document or install an add-on. The function returns a random integer between two values. Here’s how to use it.

Google表格提供了一种简单的功能,可以在电子表格内部生成随机数,而无需离开文档或安装插件 。 该函数返回两个值之间的随机整数。 这是使用方法。

Fire up the Google Sheets homepage and open either a new or existing spreadsheet. For this guide, we’ll use the function RANDBETWEEN to produce a random number.

启动Google表格首页,然后打开一个新的或现有的电子表格。 在本指南中,我们将使用函数RANDBETWEEN产生一个随机数

By default, the RANDfunction only generates a number between 0 (inclusive) and 1 (exclusive), whereas RANDBETWEEN lets you specify a range of numbers. While you could modify the function to generate other ranges, the RANDBETWEENfunction is a much simpler way to accomplish this.

默认情况下, RAND函数仅生成介于0(含)和1(不含)之间的数字,而RANDBETWEEN允许您指定数字范围。 尽管可以修改该函数以生成其他范围,但是RANDBETWEEN函数是实现此目的的一种简单得多的方法。

Click on a cell where you want to insert a random number and type =RANDBETWEEN(<Low>, <High>) but replace <Low> and <High> with the range in which you want the random number to fall.

单击要插入随机数的单元格,然后键入=RANDBETWEEN(<Low>, <High>)但将<Low><High>替换为希望随机数落入的范围。

For example, if you want a random number between 1 and 10, it should look like this:

例如,如果您想要一个介于1到10之间的随机数,则它应如下所示:

=RANDBETWEEN(1,10)
Type the function in to a cell, enter the low and high end of the random range, and then press the Enter key.

After you fill in the range, press the Enter key. The random number will populate the cell where you entered the formula.

填写范围后,按Enter键。 随机数将填充您输入公式的单元格。

After you press Enter, the random number will appear in the cell.

If you want to use a number from another cell in your spreadsheet, all you have to do is enter the cell number instead of a low or high number.

如果要使用电子表格中其他单元格中的数字,则只需输入单元格号,而不要输入低号或高号。

Use data from other cells when you type in the cell number instead.

Note: Both RAND and RANDBETWEEN are considered volatile functions, meaning they don’t retain the data in the cell forever. So, when you’re using either of the functions, they recalculate a new number each time the sheet changes.

注意: RANDRANDBETWEEN均被视为易失性函数,这意味着它们不会永远将数据保留在单元中。 因此,当您使用任何一个函数时,每次工作表更改时,它们都会重新计算一个新的数字。

If you want to change the interval in which your random number is recalculated, open up File > Spreadsheet Settings, click on the “Calculation” tab, and then choose how often you want the function to recalculate from the drop-down menu.

如果要更改重新计算随机数的间隔,请打开“文件”>“电子表格设置”,单击“计算”选项卡,然后从下拉菜单中选择希望函数重新计算的频率。

You can select “On Change” (default), “On Change and Every Minute,” or “On Change and Every Hour.” Click “Save Settings” to return to your spreadsheet.

您可以选择“更改时”(默认),“更改时和每分钟”或“更改时和每小时”。 单击“保存设置”以返回到电子表格。

Change the recalculation interval from File > Spreadsheet settings, click on "Calculation," and then choose the interval from the dropdown menu under "Recalculate."

翻译自: https://www.howtogeek.com/445056/how-to-generate-random-numbers-in-google-sheets/

表格范围内产生随机数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值