How Do I Get a Random Sample in Excel?

Excel 2013 includes several built-in functions meant to help with mathematical equations. If you're looking to test an equation, you can use the RAND function to generate a random sample number. You can also copy the results to another column without recalculating and changing the results.

Using the RAND Function

In any empty cell, type the following syntax:


This function generates a random number between 0 and 10. The type of number it returns depends on the cell's format; for example, you'll get a number with two decimal places by default since that's Excel's standard number format.

Using the RANDBETWEEN Function

If you want to generate a random sample between two specific numbers, you'll need the following syntax, replacing X with the low number and Y with the high number:


This function returns any number between the specified two. For example, RANDBETWEEN(2,9) would bring back numbers only between 2 and 9. Like the RAND function, the exact number depends on the cell's format.

Copying Generated Numbers

Highlight and copy the generated number as you normally would. Before pasting to another cell, however, right-click and locate the icons under "Paste Options." Select "Values" to paste the number; otherwise, you'll only paste the formula, which will generate a brand new number.