Hi Jules - You weren't specific about the counting process, so I did two columns. They're based on 30-minute intervals, as that's pretty standard for this type of problem. Fairly easy to lengthen them to 2 hours if you prefer.
Number of patients ADMITTED during each interval (in B2 and down):
=SUMPRODUCT((Sheet1!$C$2:$C$22 > = Sheet2!$A2)*(Sheet1!$C$2:$C$22 < Sheet2!$A2+1/48))
Number of patients ON-SITE during each interval (ARRAY FORMULA in C2 and down):
NOTE: Since Excel tracks time as fraction of a day, the 1/48 in each formula equals 30 minutes.
*You must press CTRL+SHIFT+ENTER to confirm entry of an ARRAY FORMULA in the Formula Bar.
When copying the formula to other cells, make sure the copied cell is not part of the Paste Area.
Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
Bookmarks