← All comparisons

RAND vs RANDBETWEEN vs RANDARRAY: three flavors of random

One value or a grid, decimals or integers: the random family splits by shape and type. All three share the same gotcha — volatility — and the same cure (Paste Special → Values).

The differences at a glance

RANDRANDBETWEENRANDARRAY
ReturnsOne decimal in [0,1)One integer, both bounds inclusiveA whole spilled grid — decimals or integers
Custom rangeScale manually: RAND()*(max-min)+minBuilt-in (min,max)Built-in (min,max args), plus integer flag
Many values at onceFill the formula downFill downOne formula: RANDARRAY(rows,cols,...)
Re-rolls on every editYesYesYes — the whole grid at once
Availability (executed)UniversalUniversalExcel 365, Sheets, LibreOffice 25.8+ (verified supported)

Which should you use?

Compatibility (Excel for the web, Sheets & LibreOffice executed; desktop Excel per docs)

RAND and RANDBETWEEN execute in every LibreOffice version we test (desktop Excel behavior per docs — we do not run desktop Excel; Google Sheets is executed separately, see each function page); RANDARRAY is verified supported in LibreOffice 25.8 (our harness asserts its deterministic properties — shape and bounds — since the values themselves change per recalc). All three are volatile everywhere: freeze results with Paste Special → Values, or they re-roll on every edit. Excel for the web is a separate application with its own calculation engine, and that one we do execute: all 6 corpus cases for these functions matched the documented values there (recalculated on OneDrive, 2026-09-01); the per-case values are on the individual function pages.

Example formulas

Coin flip=IF(RAND()<0.5,"Heads","Tails")
Dice roll=RANDBETWEEN(1,6)
Shuffle a list (365 / LO 25.8+)=SORTBY(A2:A53,RANDARRAY(52))

Full per-version details on each function page: RAND · RANDBETWEEN · RANDARRAY.

How-to recipes using these functions