+ Reply to Thread
Results 1 to 4 of 4

Conditional format to highlight cell that falls between two times

  1. #1
    Registered User
    Join Date
    08-30-2009
    Location
    Basingstoke, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Conditional format to highlight cell that falls between two times

    Hi

    I am looking to highlight a cell that falls between two hours.
    I.E. I have a spreadsheet with hours
    14:00 - 15:00
    15:00 - 16:00
    16:00 - 17:00
    I want the spreadsheet to check the current time ( NOW() ? ) and then highlight the cell that falls between that time.
    So if it is 16:34 then the cell between 16:00 - 17:00 should be highlighted.

    thanks in advance

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Conditional format to highlight cell that falls between two times

    well with those in a1:a5 use a formula option applied to a1:a5

    =AND(MOD(NOW(),1)>=--LEFT(A1,5),MOD(NOW(),1)<--RIGHT(A1,5))

    but you are aware that it will not update as now() has to be recalculated and this only happens when you either enter something new in a cell and press enter or press f9
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,101

    Re: Conditional format to highlight cell that falls between two times

    you could just use the Hour - if you are happy with 16:00 to 16:59.59

    =Hour(Cell) = Hour(Now())
    in the conditional format

    and so will just check the hour portion
    IE in example is HOUR = 16
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    08-30-2009
    Location
    Basingstoke, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Conditional format to highlight cell that falls between two times

    Thanks Martin, that performs exactly the task I was aiming for.

+ 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: 4
    Last Post: 07-11-2012, 12:36 PM
  2. [SOLVED] Conditional Format to highlight blank cell
    By DaveMoore in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 12:05 PM
  3. Conditional Format to highlight blank cell
    By Mangesh Yadav in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 06:05 AM
  4. Conditional Format to highlight blank cell
    By DaveMoore in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] Conditional Format to highlight blank cell
    By DaveMoore in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

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