mafallaize
New Member
- Joined
- Aug 23, 2011
- Messages
- 31
Hi all,
This problem has had me stumped for a while now. I'm looking for a formula to produce unique random dates between a date range, excluding weekends and a list of public holidays (different for each year). Like a lottery, once a date has been selected, it shouldn't be used again.
My sheet looks like this:
[TABLE="width: 585"]
<tbody>[TR]
[TD]Sampling start date
[/TD]
[TD]Sampling end date
[/TD]
[TD="align: right"]1
[/TD]
[TD="align: right"]2
[/TD]
[TD="align: right"]3
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]5
[/TD]
[/TR]
[TR]
[TD="align: right"]01/10/2017
[/TD]
[TD="align: right"]01/01/2018
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/01/2018
[/TD]
[TD="align: right"]01/04/2018
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/04/2018
[/TD]
[TD="align: right"]01/07/2018
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/07/2018
[/TD]
[TD="align: right"]01/10/2018
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
NETWORKDAYS works well for all of the above requirements, except it creates duplicates.
The Lottery style UDF posted by Jon von der Heyden here could be useful, but I couldn't get it to exclude weekends: https://www.mrexcel.com/forum/excel-questions/638342-formulae-help-please.html
Any ideas would be appreciated!
Thanks
Mark
This problem has had me stumped for a while now. I'm looking for a formula to produce unique random dates between a date range, excluding weekends and a list of public holidays (different for each year). Like a lottery, once a date has been selected, it shouldn't be used again.
My sheet looks like this:
[TABLE="width: 585"]
<tbody>[TR]
[TD]Sampling start date
[/TD]
[TD]Sampling end date
[/TD]
[TD="align: right"]1
[/TD]
[TD="align: right"]2
[/TD]
[TD="align: right"]3
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]5
[/TD]
[/TR]
[TR]
[TD="align: right"]01/10/2017
[/TD]
[TD="align: right"]01/01/2018
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/01/2018
[/TD]
[TD="align: right"]01/04/2018
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/04/2018
[/TD]
[TD="align: right"]01/07/2018
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/07/2018
[/TD]
[TD="align: right"]01/10/2018
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
NETWORKDAYS works well for all of the above requirements, except it creates duplicates.
The Lottery style UDF posted by Jon von der Heyden here could be useful, but I couldn't get it to exclude weekends: https://www.mrexcel.com/forum/excel-questions/638342-formulae-help-please.html
Any ideas would be appreciated!
Thanks
Mark