How to generate random numbers in Excel

You can generate decimals between 0 and 1, and integers between certain limits using the RAND and RANDBETWEEN functions. RANDARRAY function is a new addition to randomization formulas, which is currently only available to a number of select users, but is going to be released for all Excel users soon. In this guide, we’re going to show you how to generate random numbers in Excel.


The RAND function is fairly simple as it doesn't require any additional arguments, and returns an evenly distributed random real number that is greater than or equal to 0, and less than 1.


rand function

Please see Function: RAND article for more details on this function and examples.


The RANDBETWEEN function returns a random integer between the specified limits. It requires minimum and maximum values for arguments.

RANDBETWEEN(bottom, top)


Please see Function: RANDBETWEEN article for more details and examples.


The new RANDARRAY function offers great versatility, as it can generate an array of random numbers, and has the same features as the other two existing random number generation formulas.


Please see Function: RANDARRAY article for more details and examples.


  • Random numbers are regenerated with each calculation. Press F9 to recalculate, and get new numbers.
  • Since Excel 2010, Microsoft states Excel uses the Mersenne Twister algorithm (MT19937) to generate random numbers.