Generate random date in cells with Function
In Excel, you can mix the Randbetween and Date function to create random date, please do as follows:
1. Select a cell that you want to insert a random date, and enter this function: =RANDBETWEEN(DATE(2013, 1, 1),DATE(2013, 3, 1)).
Note: in the function, (2013, 1, 1) is the starting date, and (2013, 3, 1) is the ending date, you can replace them as you need.
2. Then press Enter key, it displays a five-digit number in the cell, and you need to convert this format to the date format.
3. Select the cell, and right-click, choose Format Cells from the context menu, see screenshot:
4. And in the Format Cells dialog box, click Number tab, and select Date from the Category, then select a date format you need from the Type drop-down list. See screenshot:
5. Click OK,
the number has been converted to the normal date format. Then click the
cell and drag the fill handle over to the range that you want to fill
with random date. And the date has been generated randomly. See
screenshot:
No comments:
Post a Comment