Counting occurrences between datetimes

JB2020

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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

arthurbr

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

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,659
Messages
5,838,645
Members
430,558
Latest member
Krampus

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