+ Reply to Thread
Results 1 to 13 of 13

Using COUNTIF to determine # of employees working each hour

  1. #1
    Registered User
    Join Date
    10-01-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Using COUNTIF to determine # of employees working each hour

    I'm using Excel to schedule employees shifts at my restaurant. Column A is their name, Column B is their start time, Column C is their end time.

    I'd like to be able to count the number of employees working during any given hour of the day to assure I've got enough staffing each hour.

    I'm thinking it will require a COUNTIF function but I can't figure out how to make it work. I've attached a sample sheet if that helps. Any assistance would be greatly appreciated.
    Attached Files Attached Files
    Last edited by Fyyzer; 10-01-2009 at 05:51 PM.

  2. #2
    Forum Contributor
    Join Date
    07-24-2009
    Location
    Valrico, FL USA
    MS-Off Ver
    Excel 2016
    Posts
    358

    Re: Using COUNTIF to determine # of employees working each hour

    Try the attached file.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-01-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Using COUNTIF to determine # of employees working each hour

    That certainly gets me the number I want but I'm wondering if there's anyway to do it without that intermediate step of the X's. The visual breakdown with the X's gets a bit cumbersome with 35-45 employees. The other issue is ideally I'd like for it to be able to account for half hours. For instance if Susie comes on shift at 9:30am and two other people come on at 9:00am I'd want it to reflect that there's 2.5 hours of labor for that 9am hour slot.

    I'd found this on another site and it seemed it might work in my situation but I couldn't make it work.

    Problem:
    Columns B & C show the times that each of a building's tenants left and returned on a particular day.
    We want to calculate the building's occupancy rate at each of the times listed in column E.

    Solution:
    Use the COUNTIF and COUNT functions as shown in the following formula:
    =(COUNTIF($C$2:$C$6,">="&E2)-COUNTIF($B$2:$B$6,">"&E2))/
    COUNT($A$2:$A$6)
    Last edited by Fyyzer; 10-01-2009 at 04:18 PM.

  4. #4
    Forum Contributor
    Join Date
    07-24-2009
    Location
    Valrico, FL USA
    MS-Off Ver
    Excel 2016
    Posts
    358

    Re: Using COUNTIF to determine # of employees working each hour

    See if this works for you.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-01-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Using COUNTIF to determine # of employees working each hour

    Looks like that'll suit my needs a bit better. I added another column to average out the hours so that I'm left with 8:00, 9:00, 10:00 etc. and I still will get the .5 hours captured using your method.

    Thanks for your help.

  6. #6
    Registered User
    Join Date
    05-30-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Using COUNTIF to determine # of employees working each hour

    Thank you so much for this post! I've been wanting to incorporate this feature into my schedules for along time!
    I was wondering how hard it would be to have it take unpaid lunch breaks in it's calculations, so that the number of people on would be actual people working?

    Thanks a million!

    Cheers!

  7. #7
    Registered User
    Join Date
    10-01-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Using COUNTIF to determine # of employees working each hour

    Easy Answer: Don't give breaks ;-)

    Tougher Answer: I'm sure it can be done but unless you're going to schedule their breaks precisely (i.e. using a formula to determine when they're breaks will occur) I'm not sure how it would ever work. In my industry (restaurants) those breaks are given as business dictates although within the framework of state/federal laws as well but they employees break could be 3.5 hours into their shift or 4.5 depending on how busy we were. For scheduling purposes I'm not sure how you could account for that shift.

  8. #8
    Registered User
    Join Date
    11-05-2007
    MS-Off Ver
    Mac 2011
    Posts
    98

    Re: Using COUNTIF to determine # of employees working each hour

    Hi guys

    I hope you dont mind me joining in on this one!

    I have attached a sample of the schedule that you worked on, I haved added in columns to allow you to add in start and finish times between breaks, i have also added in a formula which might work if some one had the know how to finish it off? it looks possible but just not sure how.

    If some one could have a look at the attached that would be great, the change to the formula starts on k7.

    regards

    Justin.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-23-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Using COUNTIF to determine # of employees working each hour

    Hi Justin,

    I tried using your formula but its not giving me any result or data.

  10. #10
    Forum Contributor
    Join Date
    01-15-2015
    Location
    New York
    MS-Off Ver
    Excel 2011 MAC
    Posts
    104

    Re: Using COUNTIF to determine # of employees working each hour

    Hi all. I'm digging up this thread because it's very close to what I'm trying to do in my sheet and don't know the proper Countif formula.

    I've attached my dropbox of the sheet
    https://www.dropbox.com/s/713q4og4ig...1%29.xlsx?dl=0

    The formula is needed in the Lines tab B8:B38. The range is in the schedule tab B8:B33 for in time. C8:C33 out time.

    In the schedule tab I have Cashier's schedules I want to be able to have their schedules tally in the Lines tab. So if there is a cashier working 8-4:30 I want there to be a "1" in the lines sheet from 8:30AM to 4:45pm (Always stops 15 minutes before the end of their shift in this case stop at 4:30). That would continue for every time listed.

    I have this formula in there and it seems to work but I know it's very basic to that first time, not sure what you would do for the next increment of time since it will need to include the previous time in it's count: =COUNTIF(Schedule!B8:B33,"8:30")

    And how do I get it to fill down stopping at 4:30 for the 8a-5p example I used above.
    Last edited by Beh162; 01-18-2015 at 02:52 PM.

  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,936

    Re: Using COUNTIF to determine # of employees working each hour

    Beh162, welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    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

  12. #12
    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,936

    Re: Using COUNTIF to determine # of employees working each hour

    Beh162, welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  13. #13
    Registered User
    Join Date
    02-18-2017
    Location
    PA
    MS-Off Ver
    2010
    Posts
    1

    Re: Using COUNTIF to determine # of employees working each hour

    Thank you so much for this information. I have found multiple other formulas with some building true and false tables. That would have been unbelievably tedious when having to deal with up to 300+ employees in any given day. This is exactly what I needed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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