Syntax
=RANDBETWEEN(bottom, top)Arguments
| Argument | Required | Description |
|---|---|---|
bottom | Required | The smallest integer it can return |
top | Required | The largest integer it can return |
How to use RANDBETWEEN
RANDBETWEEN is volatile: it recalculates every time the workbook changes, so its result can differ each time.
RANDBETWEEN takes 2 required arguments. Type =RANDBETWEEN( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=RANDBETWEEN(5, 5)Result =RANDBETWEEN(2, 1)Result Related math functions
- QUOTIENTReturns the whole number part of a division.
- RADIANSConverts an angle from degrees to radians.
- RANDReturns a random number from 0 up to (not including) 1, new on every recalculation.
- RANDARRAYReturns an array of random numbers; you choose the size, the range and whether they are whole numbers.
- ROMANConverts a number to Roman numerals as text; form 0 is classic and 1 to 4 are ever more concise.
- ROUNDRounds a number to a given number of digits, halves away from zero.
- ROUNDDOWNRounds a number toward zero to a given number of digits.
- ROUNDUPRounds a number away from zero to a given number of digits.
- SECReturns the secant of an angle given in radians.