Function Reference

RANDSEED(seed, [index1], [index2], ...)

Returns a deterministic random number in [0, 1) based on a seed and optional position indices. Drop-in replacement for RAND() that is reproducible: same inputs always produce the same output.

Parameters

Returns

A float in [0, 1). Same inputs always produce the same output.

Examples

Usage with distributions

Wrap the output in native Sheets distribution functions to shape it into any distribution:

RANDSEEDARRAY(seed, rows, [cols], [startRow], [startCol])

Returns a 2D array of deterministic random numbers in [0, 1). Single-call alternative to filling a range with individual RANDSEED formulas. Place in one cell and the result spills across the specified rows and columns.

Parameters

Returns

A 2D array of floats in [0, 1). Each cell's value is identical to what RANDSEED(seed, startRow + r, startCol + c) would produce.

Examples

Key Concepts

Reproducibility

Every output is fully determined by its inputs. Change the seed to get a different trial; keep it the same to reproduce results exactly. This makes it possible to compare model runs, share results, and debug edge cases.

Independence

Each cell's value depends only on the seed and its indices — not on evaluation order or neighboring cells. Insert or delete rows without affecting other values.