Tabular IQ
Back to Function Index

RAND()

Overview

RAND() generates a random number between 0 and 1 (inclusive). This function is useful for creating random samples, simulations, and any operations requiring random values. Each call to RAND() produces a new random number.

Function Format

RAND()

Return Value

RAND() returns a numeric value between 0 and 1

Examples


RAND() = 0.1458                    (random value between 0 and 1)
RAND() = 0.5295                    (different random value)
RAND() * 100 = 94.1597             (random value between 0 and 100)
RAND() * 10 = 7.2345               (random value between 0 and 10)
ROUND(RAND() * 6) = 4              (random integer between 1 and 6)
RAND() * (100 - 50) + 50 = 78.234  (random value between 50 and 100)

Notes

  • Important behaviors:
    • Returns a value between 0 and 1
    • No parameters required
    • Produces a new random value each call
    • Values are uniformly distributed
    • Can be scaled to any range
  • Common use cases include:
    • Random sampling
    • Simulations
    • Testing data
    • Random assignments
    • Game development
  • The function can be used in:
    • Mathematical expressions
    • Range calculations
    • Random selections
    • Probability simulations
  • This function is often used in combination with other mathematical functions to generate random values in specific ranges.
  • For random integers, combine RAND() with ROUND() or FLOOR().

See Also