+ Reply to Thread
Results 1 to 4 of 4

conditional formatting and difference in time

  1. #1
    Registered User
    Join Date
    12-16-2012
    Location
    US
    MS-Off Ver
    Excel 2011
    Posts
    2

    conditional formatting and difference in time

    Want to create a conditional format for a cell when the difference in time worked vs scheduled is greater than 2 hours. Thank you.

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: conditional formatting and difference in time

    This assumes hours worked in column a, hours scheduled in column b (or vice versa), and that the times are time values:
    =ROUND(ABS(A5-B5)*24,10)>2

    the ABS subtracts the 2 times and converts result to a positive number
    *24 converts the hours to integers
    The round(..,10) makes sure stray round off errors dis-appear
    and >2 checks the result against 2, if the resltis larger than 2 it returns TRUE, otherwise it returns FALSE

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: conditional formatting and difference in time

    Hi Time to Learn

    May be!
    A1 = Start Time & A2 = End Time
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Kevin UK; 03-17-2013 at 08:03 AM. Reason: Point out cell values A1 & A2
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  4. #4
    Registered User
    Join Date
    12-16-2012
    Location
    US
    MS-Off Ver
    Excel 2011
    Posts
    2

    Re: conditional formatting and difference in time

    Thank you.

+ 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