+ Reply to Thread
Results 1 to 11 of 11

COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

  1. #1
    Registered User
    Join Date
    12-09-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    I've used the formula =COUNTIFS(Schedule!$AC$6:$AC$96,"<"&AE$34,Schedule!$AD$6:$AD$96,">"&AD$34) for all other hours, but for a shift that spans across midnight (i.e. 11:00PM-12:00AM, 12:00AM-1:00AM, 1:00AM-2:00AM, etc.), my formula doesn't work! My AC6:AC96 are shift start times, AD6:AD96 are shift end times, AD34 and AE34 are my paramaters (11:00 PM and 12:00 AM, respectively). I am using the custom format h:mm AM/PM for all my times. Can someone please help ASAP?

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    Hi,

    For such situation I have used a helper column that contains something that indicates whether the shift end time is the next day.
    If you have columns that provide date data then you can combine the date and time so that the span across the midnight can be calculated.

    If you provide a (sanitized) working copy of your spreadsheet, I can help provide a more effective recommendation.

    Cheers

  3. #3
    Registered User
    Join Date
    12-09-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    I was trying to do it without the date, but I do have the date above it- not sure if that will help, though! Here you go! I put a sample shift in the Schedule sheet in AC31:AD31, and the formulas in AF57:AO57 in the Hourly Balance sheet are not picking them up. Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    Try

    hours between any 2 times

    =MOD(AD31-AC31,1)

  5. #5
    Registered User
    Join Date
    12-09-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    @JohnTopley - Thanks, but I don't think that will work. I need to know how many staff are on shift between these hours:
    1- 11 p.m. and midnight
    2- midnight and 1 a.m.
    3- 1 a.m. and 2 a.m.
    4- 2 a.m. and 3 a.m.
    5- 3 a.m. and 4 a.m.
    My formula works for all hours up to 11 p.m.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    If your Projected Labor will always be less than your Scheduled Labor, you might be able to use:

    Please Login or Register  to view this content.
    in AF7 ?

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    Hi, and welcome to the forum
    For situations like this, which are quite common with these time sheet type calculations, I generally add an IF Test
    your_formula+IF(end_time_cell is less than start_time_cell,24,0)

    ..once more sucuri is rejecting the If formula when the less than symbol is included
    Last edited by Richard Buttrey; 12-09-2016 at 04:15 PM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  8. #8
    Registered User
    Join Date
    12-09-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    @Logit- Thanks, but I actually need to put the formula into AF6... I'm trying to figure out which formula to use in A6 that will tell me how many employees from my "Schedule" tab are working between 11pm and midnight on that day.

    @Richard- Thanks, but I'm not sure what IF statement to use in this case... I tried another one I found, but it didn't seem to work.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    Paste the following formula into D6 and copy across:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  10. #10
    Registered User
    Join Date
    12-09-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    @JeteMc- Thank you SO much!!!

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: COUNTIFS for # of Employees Working Each Hour from 11:00 PM to 4:00 AM

    You're So Welcome. Thank You for the feedback and for taking the time to mark the thread as 'Solved'. I hope that you have a blessed day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using COUNTIF to determine # of employees working each hour
    By Fyyzer in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-18-2017, 05:46 AM
  2. How many employees at a certain hour
    By jjose1 in forum Excel General
    Replies: 14
    Last Post: 03-28-2016, 10:33 PM
  3. Count Employees Working in Half Hour Intervals
    By shanewfm in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-24-2015, 01:12 PM
  4. [SOLVED] Count the number of employees working per hour
    By esmith#001 in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 12-04-2014, 07:46 AM
  5. Calculate employees working from hour to hour
    By otter in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-03-2014, 08:57 AM
  6. Using Punchclock data to count employees working during each hour
    By ellenowski in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-13-2014, 10:22 AM
  7. Using Countif to determine number of employees working per hour
    By CBanks888 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-23-2013, 04:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1