Can time frames/windows be used as a condition for any functions?

dallas2699

New Member
Joined
Oct 16, 2024
Messages
3
Office Version
  1. 2021
Platform
  1. Windows
Hello,
I'm trying to develop a sheet that checks how many employees are active on an hourly basis. The shift patterns are in the A column of the screenshot in a 'start time' - 'finish time' format with a count of how many people are on that shift pattern in the adjacent B column. Based on their shift patterns, we can see how many people we would have per hour. For example, between the hours 15:00-16:00, anyone who has a shift time that starts before 15:00 and ends after 16:00 would be active.

What I want to know is can excel check if any of the cells in column A are within the specified time frames of column H? The obvious answer is just using the SUM function for the shifts that would be active per hour, but the shifts vary daily, so this would have to be manually inputted.
In the screenshot attached, I have highlighted what I'm trying to achieve in the literal sense (surprisingly, that formula doesn't work lol!). If anyone has any ideas that'd be great, thank you!




1729136513569.png
 
Last edited by a moderator:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Can this sheet be rearranged so that the time frame is split into start and finish across two columns?
For example: A3=10:00; B3=20:00; C3=Count
It will help simplify the formula.
 
Upvote 0
Can this sheet be rearranged so that the time frame is split into start and finish across two columns?
For example: A3=10:00; B3=20:00; C3=Count
It will help simplify the formula.
Yes that would be fine. How would you proceed from there?
 
Upvote 0
@dallas2699, welcome to the Forum!

It will help simplify the formula ...
So, for example, you could do something like this:

ABCDEFG
1
217 Oct 10:0017 Oct 20:00617 Oct 18:0017 Oct 19:0016
317 Oct 13:0017 Oct 21:301017 Oct 19:0017 Oct 20:0016
417 Oct 19:3018 Oct 6:00417 Oct 20:0017 Oct 21:0014
517 Oct 21:3018 Oct 6:00717 Oct 21:0017 Oct 22:004
617 Oct 22:0017 Oct 23:0011
717 Oct 23:0018 Oct 0:0011
Sheet1
Cell Formulas
RangeFormula
F2F2=E2+1/24
G2:G7G2=SUMIFS(C$2:C$5,A$2:A$5,"<="&E2,B$2:B$5,">="&F2)
E3:F7E3=E2+1/24

The headcount of 4 highlighted is misleading. Although there are 4 employees there for the whole hour, you have another 10 (total 14) for the first half-hour, and another 7 (total 11) for the second half hour. The easiest way to allow for this is to show more granularity, i.e. show half-hour slots in this case.
 
Upvote 0
Okay, so 30 minute intervals would be more appropriate, shifts start at either 30 minutes past or on the hour. Could I then combine the 30 minute intervals to get what I originally asked for? Also, could you breakdown exactly what's going on with the G2:G7 formula? New to excel so would like to learn :)
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

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