Quite often I am asked to create dashboards without having the actual data. When I am presented with this dilemma, I will create dummy data to use in lieu of the real data.
To generate numeric and date data, I often will use the =RANDBETWEEN formula.
The different between Excel’s RAND formula and RANDBETWEEN is that you can determine the start and end points for the random number to be generated.
=RANDBETWEEN(Starting Number, Ending Number)
In this example I use the RANDBETWEEN formula to generate numbers between 100 and 500.
The RANDBETWEEN formula only returns integers so you can’t directly generate dates. However you can add a random number generated with this formula to a date column to generate a date. In this example I generate a random number and add that to the start data of my criteria (1/1/2012). The random number increments the date by the number of days that the random number represents.
Formula for Random Number
Random Date Formula
You can also use the following formula to pick a random date keyed off of the current date. In this example I am looking for a day within 30 days of the present date:
=TODAY() + RANDBETWEEN(0,30)
=TODAY() - RANDBETWEEN(0,30)
Using the same logic, you can select a date in or within the last year you could use the following formula:
=TODAY() + RANDBETWEEN(0,365)
=TODAY() - RANDBETWEEN(0,365)
So how do we generate letters using the RANDBETWEEN formula? Return the Character specified by the code number from the character set on your computer.
=CHAR(RANDBETWEEN(65,90)) - returns one uppercase letter
=CHAR(RANDBETWEEN(97,122)) - returns one lowercase letter
=CHAR(RANDBETWEEN(65,90)) & CHAR(RANDBETWEEN(65,90)) - returns two uppercase letters
I would also like to point out that the number generated is not truly random but for most cases, can be used for generating generic data.
So how can you use the formula =RANDBETWEEN to help you complete your job?