namely.in Menu

Random name picker in Google Sheets

Names in A2 to A31: pick one, or shuffle them all.

How do I pick one name?

=INDEX(A2:A31, RANDBETWEEN(1, COUNTA(A2:A31)))
  • COUNTA counts the names source. It also counts cells that only look empty, such as a space source: clear those.
  • RANDBETWEEN, written RANDBETWEEN(low, high), gives a whole number from 1 to the count, both ends included source.
  • INDEX gives the name in that row source.

How do I shuffle the whole list?

=SORT(A2:A31, RANDARRAY(COUNTA(A2:A31), 1), TRUE)
  • RANDARRAY, written RANDARRAY(rows, columns), makes one random number for each name source.
  • SORT sorts the names by them source: one column, as many rows as the list source, so no blank cells in A2 to A31.
  • Its top three are three different names.

Why does the order change when I type?

Pressing Enter brings new numbers source. To keep an order, paste it back as values only.

No formulas: the random order. The same in Excel.