+ Reply to Thread
Results 1 to 6 of 6

Night Shift Differential including when shift goes over midnight

  1. #1
    Registered User
    Join Date
    06-25-2018
    Location
    Kansas City
    MS-Off Ver
    Office 13
    Posts
    4

    Night Shift Differential including when shift goes over midnight

    I am trying to calculate A) total hours worked B) normal pay hours C) night pay hours

    Shifts can start at any time and end at any time, but between 11:00pm and 7:00am, there is a different pay amount.

    What I am struggling with is setting the night shift parameters and correctly calculating hours when the shift goes over midnight (5:00pm-2:00am)

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Night Shift Differential including when shift goes over midnight

    .
    Not certain what is the cause but something is messing up your last two rows.

    I've tried deleting the rows completely and starting over by manually re-entering the data. NO GO. The errors continue to appear.

    Do you have some formulas somewhere in the sheet that are not easily seen when looking at your table ? Or do you have something else .. maybe a setting or something ...
    that usually is not utilized ?

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Night Shift Differential including when shift goes over midnight

    .
    On D10:E11 if you enter the date first followed by the time (format it as such), you will get the correct times in the appropriate cells.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-25-2018
    Location
    Kansas City
    MS-Off Ver
    Office 13
    Posts
    4
    Quote Originally Posted by Logit View Post
    .
    Not certain what is the cause but something is messing up your last two rows.

    I've tried deleting the rows completely and starting over by manually re-entering the data. NO GO. The errors continue to appear.

    Do you have some formulas somewhere in the sheet that are not easily seen when looking at your table ? Or do you have something else .. maybe a setting or something ...
    that usually is not utilized ?
    I thought it was because the time went over midnight?

  5. #5
    Registered User
    Join Date
    06-25-2018
    Location
    Kansas City
    MS-Off Ver
    Office 13
    Posts
    4
    Quote Originally Posted by Logit View Post
    .
    On D10:E11 if you enter the date first followed by the time (format it as such), you will get the correct times in the appropriate cells.
    It has the right hours which is a step in the right direction!

    The shift that starts at 3:00 AM has a few hours on the front end and on the back end that would be night hours, but the rest are normal day hours, but they are all categorizing as night. This must be a problem with the formula I'm using.

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

    Re: Night Shift Differential including when shift goes over midnight

    Stole this from Daddylonglegs.
    Assuming that none of the shifts are longer than 24 hours populate columns D and E with hh:mm:ss.
    Populate column K with: =MOD(E2-D2,1)*24-(E2<D2)*(23-7)-MEDIAN(E2*24,23,7)+MEDIAN(D2*24,23,7)
    Populate column J with: =F2-K2
    Note that as your profile indicates you are using the 2013 version of Excel I am attaching this an an .xlsx file
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Need Help Capturing Night Shift and Day shift FIRST login and LAST logout
    By dy137 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2017, 11:52 PM
  2. [SOLVED] Night Shift Differential
    By vaium in forum Excel General
    Replies: 9
    Last Post: 04-15-2016, 11:05 AM
  3. Need Help on Time Sheet Formula (Day Shift OK/Night Shift=Problem)
    By jomapac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-18-2013, 02:26 AM
  4. Replies: 4
    Last Post: 12-06-2012, 08:29 PM
  5. identify differential hours in a shift that goes over midnight
    By CanYouDoThis? in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2012, 03:20 PM
  6. Replies: 4
    Last Post: 09-21-2012, 12:58 AM
  7. Day shift/night shift time calculation issue
    By STATEXCEL in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-31-2007, 08:48 AM

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