← All how-to recipes

How to pick a random item from a list

✓ Verified in LibreOffice 25.8.7.3

Random winner, random assignment, random sample of one.

The formula

AppFormulaNotes
Excel=INDEX(A2:A100,RANDBETWEEN(1,COUNTA(A2:A100)))Re-rolls on every recalculation — copy → Paste Values to freeze the winner.
Google Sheets=INDEX(A2:A100,RANDBETWEEN(1,COUNTA(A2:A100)))Identical.
LibreOffice Calc=INDEX(A2:A100,RANDBETWEEN(1,COUNTA(A2:A100)))Identical.

How it works

RANDBETWEEN rolls a row number from 1 to the list's length (COUNTA keeps it sized to the data) and INDEX fetches that entry. (The verification asserts the deterministic property — whatever gets picked is genuinely from the list — since the pick itself changes every run.) It re-rolls on every edit, so freeze results with Paste Special → Values. For several picks WITHOUT repeats, modern versions can use =TAKE(SORTBY(A2:A100,RANDARRAY(COUNTA(A2:A100))),3) — shuffle, then take three.

Verified, not just documented

We ran =COUNTIF(A2:A4,INDEX(A2:A4,RANDBETWEEN(1,3)))>0 in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned True — exactly the expected result. Every formula here is confirmed by actually executing it.