The RANDBETWEEN function generates a random integer between two specified numbers. This function recalculates automatically whenever the worksheet is opened or modified.
The RANDBETWEEN function uses these arguments:
=RANDBETWEEN(bottom, top)
Bottom (Required): The smallest integer that can be returned
Top (Required): The largest integer that can be returned
USING THE RANDBETWEEN FUNCTION
To see how this function works, examine the following example:

- The formula =RANDBETWEEN(A2; B2) has been applied above
- Each time the worksheet recalculates, a new random number appears as seen below;

IMPORTANT NOTES
- The function generates a new value with each worksheet recalculation
- To prevent automatic recalculation:
- Enter the formula in the formula bar
- Press F9 to convert it to a static value
- To generate multiple random numbers at once:
- Select multiple cells
- Enter the RANDBETWEEN function
- Press Ctrl + Enter to fill all selected cells