Closed Thread
Results 1 to 9 of 9

Formula to count employees on schedule over 24 hour period

  1. #1
    Registered User
    Join Date
    06-02-2016
    Location
    PA, US
    MS-Off Ver
    2007
    Posts
    4

    Formula to count employees on schedule over 24 hour period

    Hi All,

    I create a schedule of around 25 people in a 24 hour department. What I am trying to do is find the formula to automatically generate the chart under the schedule showing how many employees are on the schedule every 2 hours throughout the day. Currently this data is entered by counting the employees manually and typing it in.

    I have attached a sample of the original schedule I use first, which I cannot seem to get to work because I have the starting time and ending time in the same cell (i.e. 10am-6pm).

    Then I have attached a manipulated schedule, which divides the start time and end time into 2 columns, switches to army time, then uses the formula:

    {=SUM(IF(A54>=B7:B31,IF(A54<C7:C31,1,0),0))}

    This nearly achieves what I am trying to do, however, it trips up when the shift hits 12AM and the formula no longer holds true.

    It seems simple enough, but I am missing something. Any help would be greatly appreciated!

    Thanks,
    Brijsek
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-10-2012
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: Formula to count employees on schedule over 24 hour period

    see i attached file and caculation is on simple base

    10 am 1
    12 pm 1
    2 pm 1 sum of (10 am+12 pm+ 2 pm) 3

    like wise
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-02-2016
    Location
    PA, US
    MS-Off Ver
    2007
    Posts
    4

    Re: Formula to count employees on schedule over 24 hour period

    Morevijay,

    Thanks for taking a look! The formula you've used does works for the data I presented, however, I should have given a broader view of the entire week. Your formula seems to work based on the employee working an 8 hour shift, but I have multiple employees who only work 6 hour shifts (TIMES IN BOLD).

    I have attached a sample including a full week schedule, along with a chart at the bottom of the schedule using the {=SUM(IF(A39>=B7:B31,IF(A39<C7:C31,1,0),0))} formula to generate the Employee Count list. As you can see, when the shift overlaps the 12AM hour, the formula no longer holds true, and the values start returning 0 (highlighted in DARK PINK).

    Any additional assistance would be greatly appreciated!

    Brijsek
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-02-2016
    Location
    PA, US
    MS-Off Ver
    2007
    Posts
    4

    Re: Formula to count employees on schedule over 24 hour period

    I hate to bump a thread, but I am still scratching my head trying to resolve this formula. Anyone??

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

    Re: Formula to count employees on schedule over 24 hour period

    This solution uses helper tables, which may be hidden for aesthetic purposes, for each day that determine when each employee starts and ends, as well as the duration, of each shift using the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then the following formula will count the number of employees either starting or having the duration of their shift corresponding to the two hour intervals listed in A39:A50
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Note: The solution is only set up for Monday, repeat the setup for Tuesday - Sunday.
    Let me 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.

  6. #6
    Registered User
    Join Date
    06-02-2016
    Location
    PA, US
    MS-Off Ver
    2007
    Posts
    4

    Re: Formula to count employees on schedule over 24 hour period

    This is perfect!! Thank you so much JeteMc and Morevijay for taking the time to help me out!

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

    Re: Formula to count employees on schedule over 24 hour period

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread 'Solved' using the thread tools link above your first post. I hope that you have a blessed day.

  8. #8
    Registered User
    Join Date
    05-15-2023
    Location
    Ipswich
    MS-Off Ver
    O365
    Posts
    8

    Re: Formula to count employees on schedule over 24 hour period

    Hello all. This is my first post, so apologise if this is against the rules. This thread has been most helpful to me, but I do have one question. I have followed the example from JeteMc but I have an issue with my sheet. Anything past midnight should be classed as the next day. How can I have this running though the days of the week? Any assistance or directions for help on a solution would be amazing.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,771

    Re: Formula to count employees on schedule over 24 hour period

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 09-26-2015, 04:27 PM
  2. [SOLVED] Count incidences within 1 hour period
    By Ucpaul in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-30-2015, 05:45 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. Formula for Hour and rest period
    By braulj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-23-2013, 07:07 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