Excel Random Numbers: Generate, Reproduce, and Use RAND

Learn to generate and control random numbers in Excel with RAND, RANDBETWEEN, and seedable methods. This guide covers reproducibility and practical examples.

XLS Library
XLS Library Team
·5 min read

Understanding Excel's Random Numbers

Excel provides two fundamental functions to generate random numbers: RAND for decimals and RANDBETWEEN for integers. RAND returns a value in the half-open interval [0, 1), which makes it ideal for simulations, probabilistic sampling, and generating synthetic data. RANDBETWEEN(min, max) returns an integer in the inclusive range between min and max, useful for test datasets or randomized selections. Both functions are volatile, meaning their outputs recalculate whenever Excel recomputes the workbook, which can be triggered by editing formulas, recalculating, or opening the file. This volatility is convenient for fresh simulations but requires care when you need stable results across sessions.

Examples:

Excel Formula
=RAND() // possible outputs: 0.234, 0.987, 0.001
Excel Formula
=RANDBETWEEN(1, 100) // randomly returns an integer from 1 to 100 inclusive

Practical note: If you want a fixed set of random numbers, generate them once and paste as values, or disable automatic recalculation before copying the results. In the next section, we explore reproducibility with seeds and deterministic sequences.

Related Articles