+ Reply to Thread
Results 1 to 17 of 17

Calculating overtime and regular time based on shift schedule.

  1. #1
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Exclamation Calculating overtime and regular time based on shift schedule.

    Hello All:

    I am trying to calculate over time based on shift time.

    For example: Regular shifts are between 7:00 AM to 3:00 PM (Monday thru Friday). Anything between those hours and on those days should be considered REGULAR TIME. Anything between 12:00 AM to 6:59 AM or between 3:01 PM to 11:59 PM should be calculated as OVERTIME.

    Anything on Saturday or Sunday should be calculated as OVERTIME as well.


    I have a few different formulas, but I can not seem to get it right. Please help!

    Thank you in advance for any help.
    Attached Files Attached Files
    Last edited by JBouquio; 11-19-2012 at 11:45 PM. Reason: modified the attachment

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Calculating overtime and regular time based on shift schedule.

    hi
    i'm having trouble opening the attachment - could you try re-loading it?

  3. #3
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Calculating overtime and regular time based on shift schedule.

    new file uploaded

  4. #4
    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
    53,048

    Re: Calculating overtime and regular time based on shift schedule.

    try these....

    for regular time
    =IF(AND(A5<TIME(7,0,0),B5<TIME(7,0,0)),0,IF(B5>TIME(15,0,0),TIME(15,0,0),A5)-IF(A5<TIME(7,0,0),TIME(7,0,0),B5))
    for OT
    =IF(AND(A5<TIME(7,0,0),B5<TIME(7,0,0)),B5-A5,IF(A5<TIME(7,0,0),A5-IF(B5<TIME(7,0,0),B5,A5),0)+IF(B5>TIME(15,0,0),B5-TIME(15,0,0),0))
    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

  5. #5
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Calculating overtime and regular time based on shift schedule.

    Hi FDibbins,

    I don't think that worked.

    Reg Hour

    START TIME END TIME TOTAL HOURS PER MAN REG HOURS OT HOURS
    6:00 AM 11:59 PM 17.98 0.33 0.37

  6. #6
    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
    53,048

    Re: Calculating overtime and regular time based on shift schedule.

    ok, i found a small error in my formula for OT...
    =IF(AND(A5<TIME(7,0,0),B5<TIME(7,0,0)),B5-A5,IF(A5<TIME(7,0,0),TIME(7,0,0)-IF(B5<TIME(7,0,0),B5,A5),0)+IF(B5>TIME(15,0,0),B5-TIME(15,0,0),0))

    not sure what the "0.33" and "0.37" in post 5 are tho, and please be more specific about what didnt work?

  7. #7
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Calculating overtime and regular time based on shift schedule.

    The 0.33 and 0.37 were the results from the formula you provided.

    I added "*24" at the end and it seems to be working better for the OT.

    I am still have problems with the REG Hours. I changed it to "=D5-F5" and it seems to be ok.

    Also if you look at line 11 on sheet "v2" if the time rolls into the next day it doesn't calculate properly.

    Please see below screenshot and attached revised spreadsheet.


    Thank you for your help.


    ts ss2.jpg
    Shift - REG Time v OT - rv1.xlsx
    Last edited by JBouquio; 11-20-2012 at 12:11 PM. Reason: updated attachements

  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
    53,048

    Re: Calculating overtime and regular time based on shift schedule.

    see the attached.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Calculating overtime and regular time based on shift schedule.

    In your spreadsheet, if you change A2 to "7:00 AM" it throws off the fomula.

    Please download my latest revision.

  10. #10
    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
    53,048

    Re: Calculating overtime and regular time based on shift schedule.

    I dont see how you're 2nd up;load is different to the version I sent you, but change the formula in G5 to...
    =IF(B5<=TIME(7,0,0),0,IF(AND(A5<TIME(7,0,0),B5<TIME(7,0,0)),0,IF(B5>TIME(15,0,0),TIME(15,0,0),A5)-IF(A5<TIME(7,0,0),TIME(7,0,0),B5)))

  11. #11
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Calculating overtime and regular time based on shift schedule.

    I am sorry, if you change A5 to "7:00 AM"

    Shift - REG Time v OT - A5.xlsx

  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
    53,048

    Re: Calculating overtime and regular time based on shift schedule.

    lol ok, try this 1...
    =IF(B5<TIME(7,0,0),0,IF(AND(A5<TIME(7,0,0),B5<TIME(7,0,0)),0,IF(B5>TIME(15,0,0),TIME(15,0,0),A5)-IF(A5<=TIME(7,0,0),TIME(7,0,0),B5)))

  13. #13
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Calculating overtime and regular time based on shift schedule.

    Sorry! with your new formula, if you change it to A5 to "8 AM" it has an error.

    What about if the time falls on a weekend? Those hours should all be OT.


    We are almost there!

  14. #14
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Calculating overtime and regular time based on shift schedule.

    I am willing to pay someone to make this work 100%. Let me know what it will cost.

  15. #15
    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
    53,048

    Re: Calculating overtime and regular time based on shift schedule.

    i have revised things a bit and created range names for the start and end times (makes the formulas easier to read). i think i have it nailed now, please test and report back.

    regarding weekends, you dont yet have anywhere to indicate dates, but im sure we can build networkdays() into the formulas

  16. #16
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Calculating overtime and regular time based on shift schedule.

    Ok, I'm back on this. I had a few things pop up.

    Where did you make your modifications? On your original upload?
    Last edited by JBouquio; 12-06-2012 at 09:48 PM.

  17. #17
    Registered User
    Join Date
    07-19-2012
    Location
    Totowa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Calculating overtime and regular time based on shift schedule.

    Please review the master spreadsheet attached.

    This might give you a better understanding on the days to cacluate the weekend work as OT. Etc.

    Working a shift from 4 PM to 3 AM the next day does not calculate properly.

    Shift - REG Time v OT - Master Sheet.xlsx

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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