Excel RANDBETWEEN function

您所在的位置:网站首页 excel里randbetween Excel RANDBETWEEN function

Excel RANDBETWEEN function

2024-04-16 21:27| 来源: 网络整理| 查看: 265

The RANDBETWEEN function returns a random integer between two numbers. The result from RANDBETWEEN is automatic, and a new random number will be recalculated each time a worksheet is opened or changed.

RANDBETWEEN is a volatile function, and can cause performance issues in large or complex worksheets.

The RANDBETWEEN function takes two arguments: bottom and top. Bottom represents the lower bound for a random number, and top represents the upper bound. RANDBETWEEN includes both top and bottom values in the range of integers that may be returned. 

Examples

Below are basic examples of RANDBETWEEN formulas:

=RANDBETWEEN(1,9) // random number between 1 and 9 =RANDBETWEEN(10,100) // random number between 10 and 100 =RANDBETWEEN(-10,0) // random number between -10 and zero Multiple results

To generate multiple random numbers in multiple cells, select the target cells, enter the RANDBETWEEN function, and press control + enter to enter the same formula in all cells at once.

Static results

RANDBETWEEN returns a new random value each time the worksheet is recalculated, including changes made to unrelated cells in the same workbook. To stop random numbers from changing, copy the cells that contain RANDBETWEEN to the clipboard, then use Paste Special > Values to convert to text. To get a single random number that doesn't change, enter RANDBETWEEN in the formula bar, press F9 to convert the formula to a static result, and press Enter to enter the value in the cell.

Note: in Excel 365, the RANDARRAY function is a more flexible alternative. RANDARRAY can generate random decimal numbers and random integers, and can also return more than one random value at the same time.

Notes RANDBETWEEN recalculates whenever a worksheet is opened or changed. RANDBETWEEN returns integers. Use the RAND function to return random decimal values.


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3