+ Reply to Thread
Results 1 to 4 of 4

Counting Staff by Hour

  1. #1
    Registered User
    Join Date
    07-24-2014
    Location
    Sacramento, CA
    MS-Off Ver
    MS Office 2010
    Posts
    3

    Exclamation Counting Staff by Hour

    Greetings,

    I've used this forum for years, but just signed up.

    I need help counting the number of staff within a time period. Unfortunately the schedule structure does not allow application of the simple solutions I've found regarding this which results in this being more complicated. My example is attached. My start and end time are in the same cell. I have used the Left() and Right() functions to manipulate the times. I am unable to count the number of occurrences of between the start/stop times of all my employees in the array. The formula also needs to take into account a manually entered time on the actual day.

    Basically:
    00:00 if F9:F42 = time is TRUE and I9:I42 = "" then count occurrences of 00:00 in scheduled times F9:F42 + if F9:F42 = time is FALSE, then if I9:I42 = time is TRUE then count occurrences of 00:00 in scheduled times I9:I42

    01:00
    02:00
    "
    "

    Sorry this is confusing. Even when I think I've gotten close the midnight time crossover keeps throwing me off. Let me know how I can clarify. I'd be ecstatic if I could get this to work.

    Thanks!

    jpickralSchd_05_TEST.xlsx

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Counting Staff by Hour

    Try to correct in I63
    =IF(AND(TIMEVALUE(RIGHT(J62,5))>H63,H64<TIMEVALUE(LEFT(J62,5))), 1, 0)
    Does it work?
    Quang PT

  3. #3
    Registered User
    Join Date
    07-24-2014
    Location
    Sacramento, CA
    MS-Off Ver
    MS Office 2010
    Posts
    3

    Re: Counting Staff by Hour

    Quang,

    This certainly worked for the 20:00-04:30, but when I changed the time to 06:00-14:30 it results in:

    0:00 1
    1:00 1
    2:00 1
    3:00 1
    4:00 1
    5:00 0
    6:00 0
    " "
    " "

    I played with it some more, and while I got it to somewhat work with:

    =IF(AND($H63>=TIMEVALUE(LEFT($J$62,5)),TIMEVALUE(RIGHT($J$62,5))>=$H64),1,0)

    It did not count the 14:00 hour nor did it properly count 20:00-04:30 when switched back. Thank you so much for your help. I feel like we're so close!


    Regards,

    jpickral
    Last edited by jpickral; 07-29-2014 at 03:08 PM.

  4. #4
    Registered User
    Join Date
    07-24-2014
    Location
    Sacramento, CA
    MS-Off Ver
    MS Office 2010
    Posts
    3

    Re: Counting Staff by Hour

    So I got:

    =IF(AND($H63>=TIMEVALUE(LEFT($J$62,5)),TIMEVALUE(RIGHT($J$62,5))>=$H63),1,0)

    to work for 06:00-14:30, but it doesn't work for 20:00-04:30. I feel like there is some simple condition test that would enable this to work both ways. But I can't quite get there.

    Again, thanks for any help!

    Regards,

    jpickral

+ 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. creating a staff rota for 24 hour shifts
    By RONJONES in forum Excel General
    Replies: 4
    Last Post: 09-06-2013, 12:02 PM
  2. Calculate required number of staff based on 45 minutes calls taken per hour
    By david1987 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-03-2013, 06:13 AM
  3. Replies: 3
    Last Post: 06-21-2013, 10:17 PM
  4. Trouble charting total staff assigned per hour in a 24hr weekly layout
    By VFsBawlS in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-07-2013, 09:18 PM
  5. Ensure 24 hour cover for staff rota
    By treebina in forum Excel General
    Replies: 1
    Last Post: 05-21-2011, 05:57 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