Breakdown of employees by hour

RJ209

New Member
Joined
Apr 21, 2020
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I want to calculate an automated breakdown of the total number of people working at any given time throughout the day when I have only their SOS (Start Of Shift) and EOS (End Of Shift) times, as well as total hours worked. So for a very basic example if I have one person working 1200-1800, another 1100-1900 and someone else 0900-1500 how many total people are working at 1600? Is there a way to calculate this using Excel?

cap123.PNG


Thanks in advance I appreciate any help!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Assuming that nobody starts before midnight and finishes after, the simple version of the formula would be

=COUNTIFS(B:B,"<="&F2,C:C,">"&F2)

This will count people that start at the time in column F or are already working, but not those that finish at the time in column F.
 
Upvote 0
Hi Jason, thanks for your help. You're right nobody starts before midnight and finishes after. I've tried the above formula but I can't seem to get it to work?
cap1234.PNG
 
Upvote 0
It looks like your SOS and EOS times are formatted as text, which will cause problems with formulas.

If it is a simple format error then the easiest way to fix that is with text to columns.

Select column B (the whole column). Go to the Data tab on the excel ribbon.
Click Text to Columns, then Next. Uncheck all boxes then click Next, then Finish.
Repeat for column C.
 
Upvote 0
Try the same on column F.

I tried a simple test and it is working for me.

Note that it will not work if any of the cells contain dates as well as times. A date that is not visible due to formatting is still visible to formulas.
 
Upvote 0
Brilliant! Formatting was the issue all solved. Everything works now thank you very much you've been a massive help :)
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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