Use RAND or RANDBETWEEN Functions to generate test data
How to use Excel's RAND and RANDBETWEEN functions to quickly generate random test data in a spreadsheet.
When you create an Excel model or template, the best way to test it is with actual data. If you don't have real data yet, you can manually type in placeholder values — but that process is tedious. A faster approach is to use the RAND or RANDBETWEEN functions to generate test data automatically.
RAND Function
=RAND()
RAND takes no arguments and generates a random decimal number between 0 and 1. To get a larger number, multiply the result by a constant:
=RAND() * 5000
This generates a random number between 0 and 5000.
RANDBETWEEN Function
=RANDBETWEEN(1, 5000)
RANDBETWEEN is more convenient when you have a specific range in mind. Enter the lower and upper bounds directly as arguments — no multiplication needed.
Usage
Enter the formula in the first data cell, then copy it down to the last row you want to fill. The entire column populates instantly with random values.
Note that the values recalculate every time you press Enter or the worksheet updates. To freeze the data, copy the range and use Paste Special → Values to replace the formulas with static numbers.