# Use RAND or RANDBETWEEN Functions to generate test data

When you create an Excel model or template, the best way is to use the actual data to test if your model is working.  But if you don’t have the actual data, you can manually type in some faked data.  However, the process is surely tedious.  An easy and quick way is to use the RAND or RANDBETWEEN functions to generate test data without the boring typing.

The RAND function has no argument.  All you need is to type in the formula =RAND().  You don’t need to put in anything within the parenthesis.  It generates random number from 0 to 1.  If you want a bigger number, you can multiply the random by a constant.  For example, you can type in =RAND() * 5000 and a random number will be generated from 0 to 5000.

The RANDBETWEEN function is handy when you have a range of data in mind and you don’t need to mess with a formula that multiplies a constant.  All you need is enter a formula like this: =RANDBETWEEN(1,5000) and a random number will be generated from 1 to 5000.

Let see the below example.  I create an Excel Spreadsheet to analyze state data.  Afterwards, I want to create some faked data for testing purposes.  So I put in the =RANDBETWEEN(1,5000) in the first cell with data (D2).  Then I copy the formula down to the last data cell.  Voila!  I got some good faked data for testing.

Please be reminded that the data will change every time you press the “ENTER” key.  If you want to freeze the data, you can copy the data range, then paste special – value to freeze the data.

All data in this website are generated by using these 2 random functions.  There are no real life actual data.  