+ Reply to Thread
Results 1 to 15 of 15

How many employees at a certain hour

Hybrid View

  1. #1
    Registered User
    Join Date
    03-27-2016
    Location
    main rd
    MS-Off Ver
    2013
    Posts
    6

    How many employees at a certain hour

    Good day colleagues, Ive searched your forums and others and have not found a definite answer. My dilema is, that I need to know how many employees I have available at a certain hour. Ive tried several formulas and have managed to done half. The problem is that when it comes to 12am to 6am excel wont count all available employees, it sometimes comes out as 0. It happens the same from 2pm onwards. Ive tried, sumproduct, count.if and others. Maybe Im doing it wrong.

    Any help is welcomed. Attacehd you will find what Im doing. (my excel is in spanish, in case yours doesnt automatically convert the formula to english)
    Attached Files Attached Files

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How many employees at a certain hour

    This might not resolve the issue, but I did notice a slight mistake in your formula (at least in the example you provided). Your formula in the 1st cell of each group starts out referencing row 3 instead of row 2 at the end of the formula.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    03-27-2016
    Location
    main rd
    MS-Off Ver
    2013
    Posts
    6

    Re: How many employees at a certain hour

    thanks for answering, it was a copy paste thing, I changed it but still the same

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How many employees at a certain hour

    The only thing I can see is that the times you want columns E and F too look for in B & C don't exist.

  5. #5
    Registered User
    Join Date
    03-27-2016
    Location
    main rd
    MS-Off Ver
    2013
    Posts
    6

    Re: How many employees at a certain hour

    They are ranges, I need excel to recognize in the given ranges how many employees there are, it worked from 6am tro 2pm but the rest didint, Im thinking it might be an hour format issue. Not sure

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How many employees at a certain hour

    Those time ranges that return 0 don't have any equivalents in columns B and C and that is why you are getting 0 as a result. The earliest time range that you have is 6:00 AM to 7:00 AM. Anything referring to times earlier than that will return 0.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  7. #7
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How many employees at a certain hour

    Thank you Ron for making what I was trying say much clearer.

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How many employees at a certain hour

    @gmr4evr1
    You're welcome. I think that there is a language problem here. The problem, I think, isn't well defined. There are time periods defined but nowhere do I see an employee count for the time periods unless the time periods are for each employee...I don't know.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,977

    Re: How many employees at a certain hour

    IF, I understand (possibly I don't) the query then this solution will give a count of the 44 employees present during a given hour. I used a table populated with the formula:
    =IF(ISNUMBER($B2),IF(ROUND($B2/(1/24),0)*(1/24)=ROUND(D$1/(1/24),0)*(1/24),"s",IF(ROUND($C2/(1/24),0)*(1/24)=ROUND(D$1/(1/24),0)*(1/24),"e",IF(OR(C2="d",C2="s",AND($B2>$C2,D$1<$C2)),"d",""))),"")
    I then counted the values "s" and "d", assuming that an employee ends ("e") his/her shift at the beginning of the hour, using the formula:
    =SUMPRODUCT((D$1:AA$1=AC2)*(D$2:AA$47="s"))+SUMPRODUCT((D$1:AA$1=AC2)*(D$2:AA$47="d"))
    Here is a copy of your file with the table and formula applied: Copy of Libro1 (time ranges spanning midnight).xlsx
    I imagine (hope even) that someone will post a one formula solution soon.
    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.

  10. #10
    Registered User
    Join Date
    03-27-2016
    Location
    main rd
    MS-Off Ver
    2013
    Posts
    6

    Re: How many employees at a certain hour

    Thanks it did help a lot, and it does solve it, however the time schedules change often and days off change almost every week. I could manage with our solution but I guess it is rather lengthly. It did gave me a good insight. I was thinking the problem might be with employees ending their shifts the day after.

    I guess language was a concern though, column a stands for my employees, numbered 1 through 44, and I separate each group into Morning, afternoon and graveyard.this is for monday which "lunes" in spanish. And column B is start shift and C is end shift

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,977

    Re: How many employees at a certain hour

    I still feel as if someone may come up with a simpler answer, however in the meantime you could move the 'helper' table and the tabulations so that it is all being handled without seeing the 'helper' table. As they often say on Food Network, presentation is everything. Here is the file again with the tables moved around and the helper table copied down to row 100 to give room for expanding the workforce: Copy of Libro1 (time ranges spanning midnight).xlsx
    Let me know if you have any questions.

  12. #12
    Registered User
    Join Date
    03-27-2016
    Location
    main rd
    MS-Off Ver
    2013
    Posts
    6

    Re: How many employees at a certain hour

    Thanks for your help JeteMc, I've been playing around with it but Im having a problem with the d's, when it comes to adding more days. It does not fill in with all the d's as it should or misplaces them.
    I've tried to work around the issue but I don't seem to find the problem. This is what I have right now
    Attached Files Attached Files

  13. #13
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,977

    Re: How many employees at a certain hour

    I found the cause, the first part of the OR function should have been ...AS3="d",AS3="s"... (a mistake I made when I moved the table) and have made the correction in the attached file: Copy of Libro1 (time ranges spanning midnight).xlsx
    Let me know if you have any questions.

  14. #14
    Registered User
    Join Date
    03-27-2016
    Location
    main rd
    MS-Off Ver
    2013
    Posts
    6

    Re: How many employees at a certain hour

    Thanks a bunch guys this has really helped me a lot as well as educate me on future excel adventures. Id like to share with you something else I tried but didn't quite make it, when it comes to working with employees entering at a fraction of an hour
    Attached Files Attached Files

  15. #15
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,977

    Re: How many employees at a certain hour

    Your second formula seems to work very well with the exception of the fractional hours. Take a look at this array formula modification to your "Method 2" formula:
    =SUMPRODUCT(MOD(1+(IFERROR(ROUND(B$2:B$47/(1/24),0)*(1/24),FALSE)<=E2)+(IFERROR(ROUND(C$2:C$47/(1/24),0)*(1/24),FALSE)>=(F2-"0:00:01"))+(E2>F2)+(IFERROR(ROUND(B$2:B$47/(1/24),0)*(1/24),FALSE)>IFERROR(ROUND(C$2:C$47/(1/24),0)*(1/24),FALSE)),2))
    Once you paste it into H2 of the file attached to post #14 you'll need to press the F2 key then Ctrl, Shift and Enter simultaneously. You can then double click it down. Notice that it takes into account the two employees that sign in at 9:15 AM and out at 6:15 PM making them available from 9 - 10 but not from 6 - 7, and it still gives a correct count (7) of the employees available from 10:00 PM to 11:00 PM.
    Let me know if you have any questions.

+ 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. [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
  3. Calculate employees working from hour to hour
    By otter in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-03-2014, 08:57 AM
  4. Calculate # of employees each hour; sumif formulas
    By sprdsheet in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-05-2014, 12:29 PM
  5. 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
  6. Average number of employees per hour
    By phiphika1453 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-22-2013, 03:25 AM
  7. calculate time for employees in 24 hour operation
    By HoweRich in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2006, 03:33 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