Excel RANDBETWEEN Function

Summary

The Excel RANDBETEEN function returns a random integer between given numbers. RANDBETEEN recalculates when a worksheet is opened or changed.

Purpose

Get a random integer between two values

Return value

An integer

Syntax

=RANDBETWEEN (bottom, top)

Arguments

Usage notes

Use the RANDBETWEEN function to get a random integer between bottom and top. For example, =RANDBETWEEN(1,50) might generate the number 28

RANDBETWEEN calculates a new value each time the worksheet is calculated. To stop random numbers from being updated, copy the cells that contain RANDBETWEEN to the clipboard, then use Paste Special > Values to convert to text.

To generate a set of random integers in multiple cells, select the cells, enter the RANDBETWEEN function, and press control + enter.

To get a random number that doesn't change when the worksheet is calculated, enter RANDBETWEEN in the formulas bar and then press F9 to convert the formula into its result.

 

Excel RANDBETWEEN Function

Summary

The Excel RANDBETEEN function returns a random integer between given numbers. RANDBETEEN recalculates when a worksheet is opened or changed.

Purpose

Get a random integer between two values

Return value

An integer

Syntax

=RANDBETWEEN (bottom, top)

Arguments

Usage notes

Use the RANDBETWEEN function to get a random integer between bottom and top. For example, =RANDBETWEEN(1,50) might generate the number 28

RANDBETWEEN calculates a new value each time the worksheet is calculated. To stop random numbers from being updated, copy the cells that contain RANDBETWEEN to the clipboard, then use Paste Special > Values to convert to text.

To generate a set of random integers in multiple cells, select the cells, enter the RANDBETWEEN function, and press control + enter.

To get a random number that doesn't change when the worksheet is calculated, enter RANDBETWEEN in the formulas bar and then press F9 to convert the formula into its result.