1. Home
  2. Functions
  3. Math
  4. RANDBETWEEN
MathVolatile

RANDBETWEEN function

Returns a random whole number between two numbers (both included).

Syntax

=RANDBETWEEN(bottom, top)

Arguments

ArgumentRequiredDescription
bottomRequiredThe smallest integer it can return
topRequiredThe largest integer it can return

How to use RANDBETWEEN

RANDBETWEEN is volatile: it recalculates every time the workbook changes, so its result can differ each time.

RANDBETWEEN takes 2 required arguments. Type =RANDBETWEEN( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=RANDBETWEEN(5, 5)Result Changes on every recalculation
=RANDBETWEEN(2, 1)Result "#NUM!"

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.