CountIFs for Time Range with Multiple Start End Times

Sloppyjo3

New Member
Joined
Jan 17, 2020
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi folks,

I am trying to do a count on people entering in the system outside of their work hours. They all start and end and different times, for example

Employee A: 7:00-4:15
Employee B: 6:30-3:45
Employee C: 8:00-5:15

My data looks like the below....is there a CountIFs I can do that will give me a count of each time outside of that particular employee's range?

6:57:27 AM​
Employee A
6:59:40 AM​
Employee A
3:00:48 AM​
Employee B
7:01:35 AM​
Employee C
5:01:37 PM​
Employee C
7:01:40 AM​
Employee B
4:02:56 AM​
Employee A
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try this:
if you want only Before start time only use Part 1 of formula and if also want Exit after End time, use total formula.
Mail Generator2.xlsm
ABCDEFGH
1TimeEmployeeEmployeeStartENDCountifs
26:57:27 AMEmployee AEmployee A7:00:00 AM4:15:00 PM3
36:59:40 AMEmployee AEmployee B6:45:00 AM3:45:00 PM1
43:00:48 AMEmployee BEmployee C8:00:00 AM5:15:00 PM1
57:01:35 AMEmployee C
65:01:37 PMEmployee C
77:01:40 AMEmployee B
84:02:56 AMEmployee A
PL2001
Cell Formulas
RangeFormula
G2:G4G2=COUNTIFS($B$2:$B$8,D2,$A$2:$A$8,"<" & E2)+ COUNTIFS($B$2:$B$8,D2,$A$2:$A$8,">" & F2)
Named Ranges
NameRefers ToCells
'PL2001'!Extract='PL2001'!$A$3:$A$3G2:G4
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Please be sure to follow & read the link at the end of the rule too!

Cross posted at: COUNTIFS for Time Range with multiple start/end times
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
That is great, and now that I see it - I am wondering how to identify on the line itself that it is or is not within the specified time range? Something like

1610653303177.png
 
Upvote 0
You should use Index Table at column E:G Then
Mail Generator2.xlsm
ABCDEFGHI
1TimeEmployeeOutside RangeEmployeeStartENDCountifs
26:57:27 AMEmployee AYesEmployee A7:00:00 AM4:15:00 PM3
36:59:40 AMEmployee AYesEmployee B6:45:00 AM3:45:00 PM1
43:00:48 AMEmployee BYesEmployee C8:00:00 AM5:15:00 PM1
57:01:35 AMEmployee CYes
65:01:37 PMEmployee CNO
77:01:40 AMEmployee BNO
84:02:56 AMEmployee AYes
9
PL2001
Cell Formulas
RangeFormula
H2:H4H2=COUNTIFS($B$2:$B$8,E2,$A$2:$A$8,"<" & F2)+ COUNTIFS($B$2:$B$8,E2,$A$2:$A$8,">" & G2)
C2:C8C2=IF(OR(A2<VLOOKUP(B2,$E$1:$G$4,2,FALSE),A2>VLOOKUP(B2,$E$1:$G$4,3,FALSE)),"Yes","NO")
Named Ranges
NameRefers ToCells
'PL2001'!Extract='PL2001'!$A$3:$A$3C3, H2:H4
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,466
Members
449,086
Latest member
kwindels

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