+ Reply to Thread
Results 1 to 3 of 3

Conditional Formatting Blocks of Time

Hybrid View

  1. #1
    Registered User
    Join Date
    08-29-2018
    Location
    New York, NY
    MS-Off Ver
    Office 2016
    Posts
    11

    Conditional Formatting Blocks of Time

    Hello!

    I am currently writing work schedules, and my objective is to highlight a row in red if I have someone going to lunch later than 6 hours after they report to work.

    Cell A1 contains "10:00 AM", Cell B2 contains "Start Work". Cell A2 contains "3:30 PM", Cell B2 contains "Lunch". But if I were to put "4:30 PM" in Cell A2 instead, I want this row to come up in red (because this is greater than 6 hours after this person's 10:00 AM start).

    Does anyone have a conditional formatting solve for this?

    Thanks in advance!

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Conditional Formatting Blocks of Time

    Use a formula for your conditional formatting something like this:

    =AND($A1<>"",$B1<>"",$B1>$A1+TIME(6,0,0))
    You can then set a red font or fill if this condition is true.

    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    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: Conditional Formatting Blocks of Time

    You could use 0.25 instead of the TIME() function, too
    6/24 = 1/4 = 0.25
    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

+ 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. Formatting alternating blocks of rows
    By ngbc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-12-2018, 08:26 AM
  2. Replies: 5
    Last Post: 05-09-2018, 12:30 PM
  3. Catagorising time into blocks
    By michellepace in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-26-2016, 03:04 AM
  4. Simplify blocks of conditional statements
    By ykobure in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2015, 02:38 AM
  5. Conditional formatting to shade blocks of rows
    By MRSH in forum Excel General
    Replies: 2
    Last Post: 07-23-2015, 07:16 AM
  6. [SOLVED] Colour conditional formatting alternating blocks of rows
    By Deanomcbeano in forum Excel General
    Replies: 7
    Last Post: 10-03-2012, 01:48 PM
  7. Replies: 4
    Last Post: 01-11-2012, 07:59 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