Calculate people present in 15 minute intervals

xhermanson

New Member
Joined
Jun 20, 2012
Messages
1
Hello, I need some assistance. I am trying to calculate how many people are present in a given time interval (15 minutes). I have listed the person, start time, end time, lunch start time, lunch end time, Breaks (2) start & end times all separate. On a separate sheet I have a set of times 5am - 5pm in 15 minute intervals. I listed the start & end times for each of these as well. I am trying to come up with a formula that will see how many people are present at that given time. My thoughts are countifs but I am seeing this is very difficult. Any assistance would be helpful (want to see how many employees are available at any given time). Thanks!!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hello
I hope I can help.
However to simplify the task you need to adjust the data a bit. You will have to ditch the lunch and break times as separate columns.
Normally the data set will need 4 columns: person/start_time/end_time/comments (optional)
Remarks for breaks and lunch can go in the comments column.
If Breaks and lunch are to be counted as absence then :
1. break start must go in as end_time
2. break end must go in as start_time (if the person comes back after break or lunch).
After you set the data in this way the task becomes quite simple - we have to check if any two time periods are overlapping partially or not.

Let's say you have two periods of time: T1 and T2.
By definition if start of T1 is after the end of T2, or if the end of T1 is before the start of T2 then the two period have nothing in common.
So in summary what you have to do is: count all records then subtract all periods that do not intersect.

For any given time interval (no matter if it is 15 minutes or not) if we say that start is TS(e.g.05:00), and the end is TE (e.g. 05:15) to find all persons present in this period you will need a formula like:

Code:
[B]=CountA([I]column with all persons[/I]) - Count(start_time column,">=" & TE) - Count(end_time column,"<=" & TS)[/B]

HTH
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

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