+ Reply to Thread
Results 1 to 5 of 5

Conditional Format If End Time & Start Time Is Less Than 11

  1. #1
    Registered User
    Join Date
    06-06-2017
    Location
    Stafford
    MS-Off Ver
    2013
    Posts
    3

    Question Conditional Format If End Time & Start Time Is Less Than 11

    Hi,

    I am trying to figure out the formula to conditionally format a cell based on total hours between an end time and a start time.
    The formula needs to work between 20:45 & 07:15 for this example, and if the time between them two times is less than 11 hours then format the cell colour to red.

    E2 - M Shift ( Cell That Needs Formatting )
    U2 - 20:45 ( End Time )
    W2 - 07:15 ( Start Time )

    Thanks in advance
    StokieWorm

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional Format If End Time & Start Time Is Less Than 11

    Highlight E2 > Conditional Formatting > New Rule > Use a formula

    =(U2-W2)*24<11

    Format: Fill color of your choice > OK > OK

  3. #3
    Registered User
    Join Date
    06-06-2017
    Location
    Stafford
    MS-Off Ver
    2013
    Posts
    3

    Re: Conditional Format If End Time & Start Time Is Less Than 11

    Thank you for the quick reply,

    Can i just ask this question, If the (End Time) is on the evening of the day before the (Start Time) is the formula slightly different and not multiplied by 24 hours?

    Regards StokieWorm

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,449

    Re: Conditional Format If End Time & Start Time Is Less Than 11

    Try:
    =(U2-W2+(U2<W2))<11/24
    Quang PT

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional Format If End Time & Start Time Is Less Than 11

    If it is possible to have a start and end time on different days, then you will have to specify the days as well.

    I would put the date and time in the same cell but you could make this calculation if they were in different cells.

+ 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. Replies: 7
    Last Post: 04-25-2020, 03:23 AM
  2. Replies: 0
    Last Post: 03-04-2016, 06:38 PM
  3. Replies: 4
    Last Post: 03-02-2016, 02:46 AM
  4. Replies: 10
    Last Post: 11-08-2014, 04:51 PM
  5. Automatic generation of Start time, end time and total time in excel
    By dreamwarden in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2013, 08:03 PM
  6. Replies: 3
    Last Post: 03-27-2012, 01:07 PM
  7. display end time automatically upon entering start time and time usage
    By stoey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-19-2008, 06:16 PM

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