RANDBETWEEN Function in Excel: Random Whole Numbers for Test Data

⏱ 1 min readUpdated 28 September 2026

MathLevel: BeginnerAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Example 2
  5. Related functions

RANDBETWEEN returns a random integer between two numbers. It recalculates on every change — convert to values when you want it fixed.

Syntax

=RANDBETWEEN(bottom, top)
Argument What it means
bottom, top Smallest and largest allowed value.

Examples

Example 1

=RANDBETWEEN(1000, 50000)

Random sales amounts for practice data.

Example 2

=DATE(2024,1,1)+RANDBETWEEN(0,365)

Random dates in 2024.

💡 Copy → Paste Special → Values to freeze random numbers.

RAND · RANDARRAY · INDEX

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong