+ Reply to Thread
Results 1 to 7 of 7

Time Constraints

  1. #1
    Registered User
    Join Date
    05-14-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    Time Constraints

    Hi ladies and Gentleman

    I am seeknig assistance with a excel formula, I am trying to get the following figured.

    e.g

    A1 (holds the time 09:00)
    B1 (holds the time 10:00)
    C1 (holds the Total time 1:00) using =SUM(B1-A1)

    Then same repeated in

    D1 (holds the time 09:00)
    E1 (holds the time 10:00)
    F1 (holds the Total time 1:00) using =SUM(E1-D1)

    I would like G1 to highlight as a colour if the time difference between C1 & F1 Exceed 12 Hours (an employee must have a total of 12 hours rest period between shifts.

    I could really appreciate some assistance.

    Thank you in advance.

  2. #2
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Time Constraints

    Hello,

    You can use the Conditional Format function on Excel (can be found at Format --> Conditional Format).

    On G1, open the Conditional Format function, and then choose formula, and put in your condition such as =ABS(C1-F1)>12. Don't forget to colour it "Red" in there!
    (copy pasta from Ford)
    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

    Regards,
    Lem

  3. #3
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Time Constraints

    I think what you need is to calculate the time difference between finishing and restarting.. Presumably that would be the difference between D1 and and B1
    or the difference between Now() and the last time out maybe ??

    =IF(NOW()-E2>=0.5,TRUE,FALSE)
    Elegant Simplicity............. Not Always

  4. #4
    Registered User
    Join Date
    05-14-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Time Constraints

    OK you got me totally confused now.... sorry I am a bit simple in this scheme lol
    I have attached the excel file and if you look at the columns I want to show a discrepancy in between with the time diffrence

    Again really appreciate all the help.


    Demo Rosta.xlsx

  5. #5
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Time Constraints

    Quote Originally Posted by atrades View Post
    D1 (holds the time 09:00)
    E1 (holds the time 10:00)
    F1 (holds the Total time 1:00) using =SUM(E1-D1)
    I would like G1 to highlight as a colour if the time difference between C1 & F1 Exceed 12 Hours (an employee must have a total of 12 hours rest period between shifts.
    Slight problem in that C1 is a time of day whereas F1 is a time difference in hours.... e.g.. C1=06:00:00 D1 = 19:00:00 F1 = 13:00:00 <-- The time difference between C1 and F1 is seven hours but the employee has worked 13 hours ....
    But what you really need is a 12 hour rest period which means the next "On" time cannot be less than 12 hours from the previous "Off"... i.e H1 must be 12 hours later than D1
    Last edited by AndyLitch; 05-01-2013 at 11:50 AM.

  6. #6
    Registered User
    Join Date
    05-14-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Time Constraints

    Yes theoretically a person must have a rest period between each working shift.

  7. #7
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Time Constraints

    So the conditional formatting in G2 would be
    =AND($D2<>"",$D2<$E1+0.5)
    ......... Apply it, test it and paste the format down
    Last edited by AndyLitch; 05-06-2013 at 02:24 PM. Reason: correction

+ 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