RANDBETWEEN

    Math & Trig

    Returns a random integer between two specified numbers.

    Translations
    EnglishRANDBETWEEN
    FrenchALEA.ENTRE.BORNES
    SpanishALEATORIO.ENTRE
    GermanZUFALLSBEREICH
    ItalianCASUALE.TRA
    PortugueseALEATÓRIOENTRE
    DutchASELECTTUSSEN
    PolishLOS.ZAKR
    RussianСЛУЧМЕЖДУ
    TurkishRASTGELEARALIK
    CzechRANDBETWEEN
    HungarianVÉL.KÖZÖTT
    SwedishSLUMP.MELLAN
    DanishSLUMPMELLEM
    FinnishSATUNNAISLUKU.VÄLILTÄ
    Syntax
    RANDBETWEEN(bottom, top)

    Arguments

    • bottomSmallest integer
    • topLargest integer
    Examples
    =RANDBETWEEN(1,6)
    1-6

    Simulates dice roll

    =RANDBETWEEN(1,100)
    Random 1-100

    Random percentage

    =INDEX(Names,RANDBETWEEN(1,10))
    Random name

    Random selection from list

    Tips & Best Practices
    • Both bounds are inclusive
    • Recalculates on each sheet change
    • Useful for simulations and games
    Common Mistakes
    • Forgetting that RANDBETWEEN recalculates on every worksheet change, just like RAND, so a value meant to stay fixed will keep shifting unless converted to a static value
    • Passing a bottom value larger than the top value, which raises a #NUM! error since RANDBETWEEN requires bottom to be less than or equal to top
    • Assuming RANDBETWEEN can return decimal values - it only generates whole numbers, so a random decimal needs a different formula built around RAND instead
    Related Functions
    RANDGenerates a random decimal between 0 and 1, the more general function that RANDBETWEEN builds a whole-number range on top of.
    RANDARRAYCan generate a whole spilled array of random integers at once when given whole-number min and max arguments, rather than one value at a time like RANDBETWEEN.
    ROUNDSometimes combined with RAND to build a custom random-range formula when RANDBETWEEN's whole-numbers-only limitation doesn't fit.
    Frequently Asked Questions

    Why does RANDBETWEEN return a #NUM! error?

    The bottom argument is likely larger than the top argument - bottom must be less than or equal to top for RANDBETWEEN to work.

    Can RANDBETWEEN generate decimal numbers?

    No, it only returns whole numbers. For a random decimal within a range, you'd need a formula built around RAND, like bottom + RAND()*(top-bottom).

    How do I keep a RANDBETWEEN value from changing every time I edit the sheet?

    Copy the cell and use Paste Special > Values to convert the formula into a fixed, static number.

    Need to translate a formula using RANDBETWEEN?

    Use our translator to convert your complete formula