Using RANDBETWEEN For Dates In Microsoft Excel

Using RANDBETWEEN For Dates In Microsoft Excel

The RANDBETWEEN function is available for use in Microsoft Excel. The function is used to generate randomized dates between a specified start date and end date. The formula syntax for the function is =RANDBETWEEN(lower value, higher value). The lower value means the starting date to be used for the randomized generation of dates while the higher value is for the end date for the said generation.

The RANDBETWEEN function is specifically useful in quickly producing a set of dates for sampling purposes. This function is a commonly used feature of Microsoft Excel.

The generation of randomized dates is easy. As long as suitable start and end dates are provided, the randomized dates will be generated almost instantly. So it is important to make sure that the start and end dates are specified in the correct format that can be understood by the system.

To demonstrate, an example below is provided showing the steps on how to properly execute the RANDBETWEEN function.

STEP 1: Select the cell or range of cells wherein you want your dates to be generated and input the function with the operator =RANDBETWEEN.

STEP 2: Regarding the two values that will be critical to the accuracy of generation, care must be taken. We need to supply the Start date (lower value) and the End date (higher value) and we will have to use the Date function for these values. In this demonstration, we will be using the following formula: =RANDBETWEEN(DATE(2016,1,1), DATE(2016,12,31)). This formula will generate a random date between January 1, 2016 (lower value) and December 31, 2016 (higher value).

STEP 3: Select the generated dates and change their format from numerical to short date.

As finished product, you will now have generated a set of random dates between the specified dates. However, every time changes are made within the workbook, the formula will automatically update, producing new dates to be generated. This is true for all files with the RANDBETWEEN formula. To protect your final generations, it is advisable to copy the cells and in the same place Paste As Values.