+ Reply to Thread
Results 1 to 28 of 28

Count the number of employees working per hour

  1. #1
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Count the number of employees working per hour

    I need assistance figuring out how to calculate the number of employees working each hour of the day. For example
    in column A is the name column B is the starting time column C is the end time, but I have employees working as follows

    8:00 AM - 4:30 PM
    10:00 AM - 6:30 PM
    12:00 PM - 8:30 PM
    6:00 PM - 2:30 AM
    11:45 PM - 8:15 AM

    If someone can tell me how to do this I would greatly appreciate it. My list is HUGE so it would be....well greatly appreciated,
    I'm stressing cuz I need this badly and I'm close but...sorry. Thanks anyone.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Count the number of employees working per hour

    Hi, welcome to trhe forum

    Have you looked at using the COUNTFS() function?

    If you still have a problem, upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    Book2.xlsxIt looks something like this. I've tried the Countif but maybe I'm doing something wrong.

  4. #4
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    I want to say thank you for your time and effort.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,583

    Re: Count the number of employees working per hour

    Pl see attached file.
    Array formula used
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    kvsrinivasamurthy

    Thank you, however can i change this to only see those working on single day throughout the posted hours?

  7. #7
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    kvsrinivasamurthy,

    This is a piece to the overall report. I need to assess the amount of staff needed to do certain jobs on an hourly and daily basis.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Count the number of employees working per hour

    I've tried the Countif but maybe I'm doing something wrong.
    I actually sai countifS().

    countif() allows 1 criteria, countifS() allows for multiple

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Count the number of employees working per hour

    OK try this, based on your sample workbook, copied down and across...
    =COUNTIFS(OFFSET($A$4,MATCH(R$5,$A$5:$A$11,0),1,1,14),">="&$Q6,OFFSET($A$4,MATCH(R$5,$A$5:$A$11,0),1,1,14),"<"&$Q7)

  10. #10
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    FDibbins,

    I'm not sure I understand, "copied down and across"?

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Count the number of employees working per hour

    copy that to R6

    Then copy it down as far as you need it, and copy it across for all names. In other words, copy it into your entire (2nd) table

  12. #12
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    I miscommunicated here the formula in column R thru X isn't working properly "=AND(Q29>=$B$11,$C$11>Q29)" this
    is from cell X29, if correct it would say TRUE because at the 4am hour this person is working (11:45pm to 8:15am). The formula I have in column Y is used to add up all the "TRUE" allowing me to determine how many people I have working that time frame. Column Y does its job, but the preceding columns R-X...don't work!

  13. #13
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    FDibbins, I got a #NAME? error throughout the table.

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Count the number of employees working per hour

    hmm your profile saya excel 2000 but your uploaded file is .xlsx - 2007 or later. What version are you actually using?

  15. #15
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    I'm using my old desk top, the 2007 is from the laptop which I thought I brought home.

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Count the number of employees working per hour

    OK countifS() only works in 2007 and later. Try this instead...
    =SUMPRODUCT(--(OFFSET($A$4,MATCH(R$5,$A$5:$A$11,0),1,1,14)>=$Q6),--(OFFSET($A$4,MATCH(R$5,$A$5:$A$11,0),1,1,14)<$Q7))

  17. #17
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    Are you saying that would be the issue for the error?

  18. #18
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    Let me get on another system, I'll be right back.

  19. #19
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    I got some values but mostly zeroesBook3.xlsx

  20. #20
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Count the number of employees working per hour

    I would throw it into an interval calendar. I just built one real quick you can expand it to be in 15 min intervals which would double the width of the table... currently in Half hour intervals. Now if you do I would group into the half hour so that it is not so wide when browsing...

    Take a look, this is how I would setup a schedule check if I was making one... Then you can extend it to add lunches and breaks accordingly...

    Book2_ScheduleExample.xlsx
    -If you think you are done, Start over - ELeGault

  21. #21
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Count the number of employees working per hour

    I would also throw in some CF (Conditional Formatting) to better illustrate visually what is happening on a given day..

    I suppose I should explain too...
    To start off, I pull in the Start/End times based on the day selected on the IntervalCount tab

    Please Login or Register  to view this content.
    This is just doing a VLookup match, you will notice I added header info to your Schedule tab for this process.

    Then I listed out each interval in 30 minute increments. Once you have that setup, the table can be filled with the following formula

    Starting In F5 and then repeated down and across.
    Please Login or Register  to view this content.
    What is happening?

    First I check the start time C5 to see if the person is ON that day.
    If they are OFF it will display O all the way across
    IF they are on I must first check to see if they are grave or day shift.

    This is done by checking if the End time is Less than the start time
    Now that we know that we do one of two things

    For grave shifts I want to know if the End time is less than or equal to the current interval and the Start time is Greater than the current interval.
    If that is true than it should be blank as that means they are not on, otherwise place an X

    For day shift I want to know if the Start time is less than or equal to the current time and that the end time is greater than the current time. This means they are on so again lets place an X to indicate they are here and than leave it blank if they are not.

    Now up top I can do a count of X in the column to say how many are on in a given interval, adding 2 half hours/2 to get the total per hour.

    Let me know if you have questions about anything I put in there that I did not explain -

    This is not the only way to set it up, nor does it means it is the right way for you... but this is definitely the route I would take for scheduling anything

    Enjoy

  22. #22
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    ELeGault,

    To be honest I've never heard of this.

  23. #23
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    ELeGault,

    I think I can do this, the values come out right and the I was planning to convert to military time to simplify my formulas. Thank you, very much

  24. #24
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    I want to thank everyone. Its good to know there are people that are willing to help others out there. I appreciate it.

  25. #25
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Count the number of employees working per hour

    Well probably cause I somewhat made it up based on need...
    But now that you have heard... And seen!
    Is this beneficial and/or does it help for what you are using counts for... or does this go beyond what you need?

    Not sure if you were saying... "I don't like it don't want it" or... "I Don't know what this is'

    Did the file open for you?


  26. #26
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Count the number of employees working per hour

    Was eating and typing - you already responded - Glad it will do the trick... Enjoy - and yea this Forum is pretty good that way. Be sure to contribute some knowledge on anything you see open if you feel you have a good method or thought to add!

    And don't forget to set this thread to Solved under Thread Tools

  27. #27
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    ELeGault,

    Worked like a charm. Already put in place, just need to do a few adjustments add a couple of charts and I'm good to go. Thanks again!

  28. #28
    Registered User
    Join Date
    11-30-2014
    Location
    Ohio, US
    MS-Off Ver
    2000
    Posts
    17

    Re: Count the number of employees working per hour

    ELeGault,

    Worked like a charm. Already put in place, just need to do a few adjustments add a couple of charts and I'm good to go. Thanks again!

+ 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. 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
  3. 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
  4. Average number of employees per hour
    By phiphika1453 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-22-2013, 03:25 AM
  5. Number of employees working at given time
    By Scott in forum Excel General
    Replies: 1
    Last Post: 12-28-2005, 08:30 PM

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