Counting occurrences between datetimes

JB2020

Board Regular
Joined
Jul 29, 2020
Messages
75
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.
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

arthurbr

Well-known Member
Joined
Dec 8, 2006
Messages
2,201
Office Version
  1. 2010
Try =MOD(end_time-start_time,1) to calculate time diff
 

Watch MrExcel Video

Forum statistics

Threads
1,127,600
Messages
5,625,741
Members
416,132
Latest member
Chandan Choubey

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
Top