Contact

RANDBETWEEN Function in Apple Numbers: Syntax, Examples, and Troubleshooting

Numeric Beginner Apple Numbers

Generate a bounded random integer with correct argument order and reproducible spreadsheet experiments.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Apple Numbers. How formula examples are checked

Quick answer: =RANDBETWEEN(1,6) returns a randomly selected integer within the requested integer limits, suitable for simulating a six-sided die. Unlike RAND(), it accepts two required numeric bounds.

When to use RANDBETWEEN

Use RANDBETWEEN to generate integer test inputs, select an index among a known number of rows, or simulate bounded choices. Apple’s RANDBETWEEN reference says it returns an integer within a specified range and that a new random number is generated whenever any cell is changed. Its documented description is not evidence of a stable seeded sequence or of a particular probability distribution.

Exact Apple syntax and argument order

=RANDBETWEEN(lower, upper)

Argument: lower

Required?
Yes

Official type
Number value

Meaning
Minimum bound. Listed first.

Argument: upper

Required?
Yes

Official type
Number value

Meaning
Maximum bound. Listed second.

There are no optional arguments or defaults in Apple’s documented signature. Do not swap the bounds, use RAND-style empty parentheses, or confuse these labels with Apple’s number-cell formatting.

Documented source: RANDBETWEEN — Apple Functions Help 15.4. Apple’s example =RANDBETWEEN(1,10) produces different integers on successive recalculations; it does not promise any one value.

Worked worksheet: bounded choices

In a new Numbers table named Random Integer Lab, type the labels in column A and formulas in B. Leave other cells empty.

Cell: B2

Label
Dice roll

Enter this formula
=RANDBETWEEN(1,6)

Expected set or property, not a fixed draw
Integer 1 through 6

Cell: B3

Label
Single-digit code

Enter this formula
=RANDBETWEEN(0,9)

Expected set or property, not a fixed draw
Integer 0 through 9; leading zeros require separate text formatting

Cell: B4

Label
Balanced-style indicator

Enter this formula
=RANDBETWEEN(0,1)

Expected set or property, not a fixed draw
Integer 0 or 1; not a documented proof of equal probability

Cell: B5

Label
Test temperature

Enter this formula
=RANDBETWEEN(-5,5)

Expected set or property, not a fixed draw
Integer in the specified signed bounds

Cell: B6

Label
A random user group

Enter this formula
=IF(RANDBETWEEN(1,2)=1,"A","B")

Expected set or property, not a fixed draw
Text A or B

These outcomes are a documentation-checked expected domain, not observed Numbers results. Exact draws must not be printed as guaranteed expected output. Both bounds should be integers in these reproducible exercises because Apple’s checked page does not specify how fractional bounds are rounded or rejected.

Advanced: use lower and upper from worksheet cells

Put 2 in D2 and 7 in E2 in the same table, then enter =RANDBETWEEN(D2,E2) in F2. The expected result is an integer between 2 and 7. This lets a user adjust the lower and upper limits without changing the formula text. Before using cells from another table, see Apple’s cell references help; D2 on a different table isn’t an unambiguous cross-table reference.

Advanced: choose a color from a fixed list

Apple documents CHOOSE(index, value, value…) with a one-based index: official Apple CHOOSE, Help 15.4. Enter =CHOOSE(RANDBETWEEN(1,3),"Red","Green","Blue") in F4. The random integer from 1 through 3 becomes the index, so the mathematically expected output is one of Red, Green, or Blue; no particular result is predictable. Both underlying function signatures have been checked against Apple’s documentation. Their nested composition has not been executed in Numbers and remains untested in the native application.

Troubleshooting and documented limits

Problem What to check Assurance level
Missing second argument Apple requires both lower and upper. Official signature.
Non-numeric lower/upper input Both are documented as number values; replace text with numeric entries. Official argument type, error text not documented.
Lower bound exceeds upper Correct the bounds to the intended order before relying on the result. Sensible domain check; exact Numbers error behaviour not verified.
Bounds include decimals Use integer limits for the reproducible exercises; test decimal-bound behaviour in Numbers instead of importing Sheets or Excel rules. Official page silent on rounding.
Results change when editing Apple’s note says a new random number is generated when any cell is changed. Official Apple note.
Results are not fixed for a screenshot The function is intentionally random and volatile. Official definition and note.

Unlike a unique-ID generator, repeated values are possible. Never use RANDBETWEEN alone as a collision-free invoice key or secure authentication code.

Cross-software compatibility without assuming identity

Excel RANDBETWEEN documents a comparable bounded integer generator and explicitly states endpoint treatment. Google Sheets RANDBETWEEN gives its own treatment of fractional bounds. Those vendor-specific decimal rules have not been confirmed for Apple Numbers; don’t claim parity without native execution. Recalculation policy is also software-specific.

Use Apple RAND for a numeric fraction from 0 inclusive to 1 exclusive, or Apple RANDARRAY when a table-like array of random values is needed. For choosing a value by position, consult Apple’s Reference functions catalogue rather than assuming Excel’s INDEX behaviour is identical.

Regional settings, cell references, and compatibility

The examples above use Apple’s English-help convention: a comma separates function arguments and a dot denotes a decimal fraction. Apple’s Functions overview says that a semicolon replaces the argument comma when the decimal separator is a comma. For example, a localized two-argument formula uses ;. Function names remain unchanged; display of numeric results depends on document settings. Refer to Apple’s cell-reference instructions when formulas cross tables; the plain B2 examples here intentionally assume all referenced cells are in the same table. Do not copy B2 from one table into another and assume it still points at the intended source.

Sources and further reading

  • RAND — continue with a related Apple Numbers calculation.
  • ROUND — continue with a related Apple Numbers calculation.
  • INT — continue with a related Apple Numbers calculation.

For a software-specific comparison: LibreOffice Calc RANDBETWEEN, Apache OpenOffice Calc RANDBETWEEN. A shared name does not establish identical argument, error or version behaviour.

How this guide was checked

The linked official function documentation was reviewed on October 12, 2026. Apple’s Formulas and Functions Help 15.4 identifies the documentation edition, not a minimum Numbers release or a guarantee of historical platform parity. Selected worked examples were checked using independent mathematical or text-processing models; results are expected values, not observations from the spreadsheet application. Native Apple Numbers execution was not performed. Undocumented coercion, exact error messages and platform-specific behaviour remain unverified.

View reproducible example inputs and independent check results. This record is not a native spreadsheet test log.