Auto-plotting data into a field


The spreadsheet I created is very simple: The rows are days of the month, the columns are hours (see below). I want to be able to use a master spreadsheet to put in activities. For example: Activity 1 needs to happen XX number of times between two dates in some kind of hour-based time frame. So August 1-10 between 6am and 11am. And I want it to automatically and randomly plot that info into unassigned spaces.

In the example below, activity “1” got scheduled on Aug 1 in the second slot of 4pm hour, then again on Aug 2 in the first slot of the 6am hour, and so on.

Any ideas on how to automatically schedule activities into a grid based on date/time settings?

Thank you in advance!