Referring to a prior 1 in a column that is randomly separated
Is there a way to say in column AA, if the prior 1 in column Z is the same date or if the prior 1 in column Z is both after "20:00:00" and one day earlier, then 1 (true)?
I am trying to calculate the number of nights (12 hrs) when an event occurred. Y shows if any 2 consecutive hours occurred. Z takes consecutive hours and makes them a single event. In the example below at 2:52 on the 16th nothing happened for an hour but there was a subsequent event so that night counts as 2 not 1 -- which I don't want. (On other nights there may be more than 1 hour of separation).
MacBook Pro 15″, macOS 10.14