for X, 41362 is today's number and Y would be your upper date range. You could also use the today function "Today()" and the function would always generate dates today or beyond. Just format the cell as a date and it will work fine. Hit F9 to recalculate new dates.
If you wanted random dates within one year of today:
=randbetween(today(),today()+365)
When you say "exclude some dates" do you want them just to not appear or to be recalculated if they are randomly selected?