Fill two columns with random dates

2019-08-23 06:25发布

I have to generate 10000 random dates in Excel. I found some website to do that, but the problem is I need fill out two columns ( pickup date, return date).
How can I coordinate between them where return date must be greater than pickup date? Is there any website or functions in Excel to do it?

标签: excel
2条回答
仙女界的扛把子
2楼-- · 2019-08-23 06:43

You can use the RANDBETWEEN function to generate dates between a certain range e.g.:

 =RANDBETWEEN(DATE(2014,1,1),DATE(2014,1,26))

Then, in the second column, use the value in the first column as the date lower bound e.g.:

 =RANDBETWEEN(A1,DATE(2015,1,1))

Note that the output of RANDBETWEEN is a number that is Excel's underlying date representation, therefore you need to format the output cells as a date.

查看更多
Evening l夕情丶
3楼-- · 2019-08-23 07:01

Use a custom written script in Python, perl, or whatever you know or can learn, and create a CSV file. Import this CSV file into Excel. If you don't know how to program this might be a little too complex of a task, but this is the only direction of advice which is on-topic on this site.

If you need help post a new question with you attempt of a solution.

查看更多
登录 后发表回答