How to Generate Random Dates in Excel (With Examples)


You can use the following formula to generate a random date between a specific date range in Excel:

=RANDBETWEEN($A$2,$B$2)

This formula assumes that the start date is in cell A2 and the end date is in cell B2.

By default, Excel will display this random date as a numeric value but you can use the Number Format feature in Excel to instead display it as a date value.

The following example shows how to generate random dates in Excel in practice.

Example: Generate Random Dates in Excel

Suppose we would like to generate a random date in Excel between 1/1/2000 and 12/31/2023.

We can type these start and end dates into cells A2 and B2, respectively, and then type the following formula into cell C2 to generate a random date between these two dates:

=RANDBETWEEN($A$2,$B$2)

The following screenshot shows how to use this formula in practice:

The RANDBETWEEN function generates a random date between this date range but the date is displayed as a numeric value by default.

Note: The numeric value represents the number of days since 1/1/1900.

To convert this numeric value to a date, we can highlight cell C2 and then click the Number Format dropdown menu on the Home tab, then click Short Date:

The numeric value will automatically be converted to a date:

Excel generate random date between date range

We can see that the RANDBETWEEN function generated a date of 4/3/2006, which is between the start and end dates that we specified.

Note that we can also click and drag this formula down to more cells in column C to generate several random dates between this date range:

Notice that all of the random dates are within the date range that we specified.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

How to Compare Dates Without Time in Excel
How to Use SUMIFS with a Date Range in Excel
How to Filter Dates by Month in Excel

Leave a Reply

Your email address will not be published. Required fields are marked *