I am putting together a spreadsheet to count people present during each hour of the day over a monthly period that includes a consideration for overnight times. I am running into a few difficulties though and could use some guidance.

People are column A (there are over 3,000 listed)
Checkin Date column B
Checkin Time column C
Checkout Date column D
Checkout Time column E
(Note: date/time can be combined for both checkin and checkout, but I have not found this to be helpful since I am not doing daily and hourly counts. I also have a length of stay column, although I have not been able to figure out the best way to utilize this data.)

Times-- 00:00, 01:00, 02:00, 03:00, and so on are the next 24 columns

I have not been able to find a way to tally the times when the checkin time is before midnight and the checkout time is after midnight.