Counting occurrences between datetimes

JB2020

Board Regular
Joined
Jul 29, 2020
Messages
88
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
Hi
I have one data set containing a list of arrival datetimes and departure datetimes for customers. I am looking to create a separate table containing a column of times, by minute (00:00, 00:01 ... 23:59), as well a count of all occurrences of that time where it falls between the arrival and departure time, with the view of calculating the number of customers in the store at any given time. The problem I am having is that people can arrive at, for example, 23:00 and leave after midnight. Therefore, if the date is removed, the departure time can be less than the arrival time, which means I can't use a simple COUNTIFS formula (I think). I did figure out a long-winded array formula to calculate it, but am looking for something more efficient and simple, given the data set is fairly large, if anyone has any suggestions?
Thanks in advance.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Try =MOD(end_time-start_time,1) to calculate time diff
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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