Running Count by Hour of the Day

dblackwood

New Member
Joined
Sep 27, 2019
Messages
1
Hello,

I have a problem that I cannot solve... I have a dataset that includes an "Arrival Time", an "Exit Time", and a calculated "Hours in Department". I am trying to calculate to number of visits that are currently in the department at each hour of the day.

Example: I have 3 visits that come in at 1:00 and they stay for 3 hours, I have 2 visits that come in at 2:00 and they stay for 1 hour. The count for 1:00 = 3, 2:00 = 5 (because the 1:00 visits are still present), 3:00 = 5, 4:00 = 3, 5:00 = 0.


I have assumed it would involve a countifs or sumproduct function, but I cannot get the duration time to factor.

Thanks for listening and hopefully a solution!!

Sorry, I do not have permissions to attach a example file at this time.

David
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi, welcome to the forum!

Something like this maybe..


Excel 2013/2016
ABCDEF
1VisitInOutHour# Visits
2101:0004:0001:003
3201:0004:0002:005
4301:0004:0003:005
5402:0003:0004:003
6502:0003:0005:000
Sheet1
Cell Formulas
RangeFormula
F2=COUNTIFS(B:B,"<="&E2,C:C,">="&E2)
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top