+ Reply to Thread
Results 1 to 14 of 14

Track employees which cross shifts and counted one time each shift

  1. #1
    Registered User
    Join Date
    09-29-2013
    Location
    NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    10

    Track employees which cross shifts and counted one time each shift

    I hung in for days trying to find the info here, but I think it's beyond my ability.

    I'm trying to track the number of employees on each shift while writing the schedule. I copied one column of the schedule and what I thought would work.

    Can any of you point me in the right direction?

    Note, some employees cross shifts and need to be counted one time on each shift.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,522

    Re: Track employees which cross shifts and counted one time each shift

    Welcome to the forum. A couple of suggestions before we come to the formalities ... 1) maybe add an explanation to your sample workbook so we better understand your logic; which entries are counted in which slot and why? Are you counting the In or the Out? 2) it would probably help to split the time ranges into separate start and end cells.

    And, the formalities ... not entirely sure what happened there but the thread title has magically changed so forget what I was going to say about formalities
    Last edited by TMS; 10-01-2013 at 07:34 PM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-29-2013
    Location
    NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    10

    Re: Track employees which cross shifts and counted one time each shift

    Quote Originally Posted by TMShucks View Post
    Welcome to the forum. A couple of suggestions before we come to the formalities ... 1) maybe add an explanation to your sample workbook so we better understand your logic; which entries are counted in which slot and why? Are you counting the In or the Out? 2) it would probably help to split the time ranges into separate start and end cells.
    Thanks for the welcome...

    My logic is best described in the sample math in the red box's. Simply put (but not as simply accomplished for me), I just needed the red box's to add 1 each time a person is scheduled for that shift segment.

    The only one I could get to work as expected is 9pm 12:30am =SUM(COUNTIF($D$7:$D$48,{">=11:59:00 PM","<=12:30 AM"})*{1,1})

    I'm going to assume what I need is better accomplished by separating the "IN" times to one column and the "OUT" times to another. Which I have already done. The post here was more of a "I give up, was this ever even possible"? Since I wasted 3 days trying to do it when I should have separated the columns day 1.

    Live and learn I guess ehhh?

    Quote Originally Posted by TMShucks View Post
    And, the formalities ... not entirely sure what happened there but the thread title has magically changed so forget what I was going to say about formalities
    I think it was probably a helpful moderator. Oddly enough I read the rules and still managed to let my frustration empty my head out.

  4. #4
    Registered User
    Join Date
    09-29-2013
    Location
    NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    10

    Re: Track employees which cross shifts and counted one time each shift

    OK here is what I came up with and I still have an error...

    The period in red is not calculating correctly and adding 1 to each shift segment as expected. I have hit a wall and I can't get past this. It seems any shift that goes past 12 AM is ignored. Can one of you experts lend a hand?

    Sample work book attached...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-29-2013
    Location
    NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    10

    Re: Track employees which cross shifts and counted one time each shift

    Maybe if I show a clearer example, or is what I am attempting just simply not possible?

    new workbook sample...
    Attached Files Attached Files

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,522

    Re: Track employees which cross shifts and counted one time each shift

    I can't think how to approach this ... so I've called in the cavalry. Hopefully someone will have some good ideas.

    http://www.excelforum.com/the-water-...ml#post3448892


    Regards, TMS

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,317

    Re: Track employees which cross shifts and counted one time each shift

    You need to incorporate a check to see if start-time is greater than finish time, like this in M9 of your 2t29 workbook:

    =SUMPRODUCT((MOD(I$3:I$7,1)<K9+(I$3:I$7>J$3:J$7))*(MOD(J$3:J$7,1)+(I$3:I$7>J$3:J$7)>J9))

    then copy this down.

    Hope this helps.

    Pete

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Track employees which cross shifts and counted one time each shift

    Try this formula for F9 copied down

    =SUMPRODUCT(((B$3:B$7<D9)+(C$3:C$7>C9)+(C$3:C$7<B$3:B$7)>=2)+0)
    Last edited by daddylonglegs; 10-23-2013 at 02:21 PM.
    Audere est facere

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,522

    Re: Track employees which cross shifts and counted one time each shift

    @Pete/DLL: thanks for wading in.

    Regards, TMS

  10. #10
    Registered User
    Join Date
    09-29-2013
    Location
    NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    10

    Re: Track employees which cross shifts and counted one time each shift

    Unfortunately, neither of these work, but I do appreciate the help.

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Track employees which cross shifts and counted one time each shift

    The formula I suggested should give you the correct results for the example given, was that not the case?

    I'm not clear whether you want to count whole shifts covered only or include partial shifts - perhaps you could give an example where my suggestion doesn't work and explain what the results need to be?

  12. #12
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,317

    Re: Track employees which cross shifts and counted one time each shift

    My formula also works, giving the results 3, 3, 3 and 1 which is what you had in column F. Are these not what you expected?

    See attached file.

    Pete
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-29-2013
    Location
    NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    10

    Re: Track employees which cross shifts and counted one time each shift

    Thanks for the help, I have decided it is not possible and I see no reason to drive you guys nuts with this.

    I will be ending shifts @ 11:59 pm for the schedule purposes.


    Thanks again for the help.

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Track employees which cross shifts and counted one time each shift

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. How to keep track of employees event dates
    By bobbych in forum Excel General
    Replies: 6
    Last Post: 05-21-2012, 11:55 AM
  2. Shift roster for 3 shifts
    By shivaraj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-24-2011, 06:35 AM
  3. Shifts employees timesheet
    By sam007 in forum Excel General
    Replies: 18
    Last Post: 02-26-2009, 10:12 AM
  4. Employees shift schedule
    By rossi in forum Excel General
    Replies: 1
    Last Post: 06-04-2006, 07:15 PM
  5. template to use to track employees
    By Jasmine in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-10-2006, 12:10 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