The RANDBETWEEN function

Returns a random whole number between a bottom and a top number, both included. It changes every time the sheet recalculates.

Syntax

RANDBETWEEN(bottom, top)
bottom
The smallest number it can return.
top
The largest number it can return.

Examples

B1=AND(RANDBETWEEN(1,6)>=1,RANDBETWEEN(1,6)<=6)
AB
1TRUE
B1=MOD(RANDBETWEEN(10,99),1)
AB
10
C1=ISTEXT(INDEX(A2:A5,RANDBETWEEN(1,4)))
ABC
1NameTRUE
2Ann
3Ben
4Cy
5Dee

Questions

Is the top number included in RANDBETWEEN?

Yes. =RANDBETWEEN(1,6) can return 1, 6 and every whole number between them, like a die.

How do I pick a random name from a list?

Use RANDBETWEEN for the position and INDEX to fetch it, as in =INDEX(A2:A5,RANDBETWEEN(1,4)). Change the 4 when the list grows, or use ROWS(A2:A5).

Related functions