+ Reply to Thread
Results 1 to 7 of 7

Conditional formatting if cell's value is less than today and specific time

  1. #1
    Registered User
    Join Date
    04-18-2012
    Location
    Shreveport, LA, USA
    MS-Off Ver
    Office 2013
    Posts
    63

    Conditional formatting if cell's value is less than today and specific time

    Hey guys,

    I have a situation I've never encountered before and am having some trouble with it.

    I have a column with vlookups in each cell that return a specific date and time from data that I dump into this file each day. I'm trying to set up conditional formatting to highlight the cell and text in red IF the value in the cell, returned by the vlookup, falls before the current day at 9:00:00 am. For example, if the value returned in the cell says Wednesday, April 1, 2015 1:00 PM, I want it to highlight in red. Even if it shows today's date but 8:59 AM or before, I also want it to highlight the same way.

    Everything I've been able to come up with so far hasn't done the trick.

    Thank you. If you need further clarification, let me know.

  2. #2
    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,052

    Re: Conditional formatting if cell's value is less than today and specific time

    1st, check that your date/time actually IS date/time (numbers) and not text looking like a date/time.
    test with =isnumber(cell_ref)
    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

  3. #3
    Registered User
    Join Date
    04-18-2012
    Location
    Shreveport, LA, USA
    MS-Off Ver
    Office 2013
    Posts
    63

    Re: Conditional formatting if cell's value is less than today and specific time

    Quote Originally Posted by FDibbins View Post
    1st, check that your date/time actually IS date/time (numbers) and not text looking like a date/time.
    test with =isnumber(cell_ref)
    Yes, isnumber is returning a value of True when I use it to verify.

  4. #4
    Registered User
    Join Date
    04-02-2015
    Location
    MO
    MS-Off Ver
    2010
    Posts
    9

    Re: Conditional formatting if cell's value is less than today and specific time

    Select the cells/column to which you want to apply conditional formatting.

    Conditional formatting -> New Rule -> Use a formula to determine which cells to format

    Then enter this formula in the "Format values where this formula is true:" field:

    =cell range<(TODAY()+(9/24))

    Then you can just assign whichever formatting you want if that formula comes back "True".

    Hope this helps.

  5. #5
    Registered User
    Join Date
    04-18-2012
    Location
    Shreveport, LA, USA
    MS-Off Ver
    Office 2013
    Posts
    63

    Re: Conditional formatting if cell's value is less than today and specific time

    Thanks for your help. When I enter that, and hit OK, I get the following error in Excel:

    "You may not use reference operators (such as unions, intersections, and ranges) or array constants for Conditional Formatting criteria."

  6. #6
    Registered User
    Join Date
    04-02-2015
    Location
    MO
    MS-Off Ver
    2010
    Posts
    9

    Re: Conditional formatting if cell's value is less than today and specific time

    See the attached file. I created a reference for today's date at 9AM in cell A2, and then applied the conditional formatting using that cell as a reference.

    Here is the formula used in the conditional formatting screen:

    =A4<$A$2

    You can either select your whole range before entering this formula to make it apply to everything, or use the format painterto apply to your range after you create it for one cell.
    Attached Files Attached Files

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional formatting if cell's value is less than today and specific time

    Select the range that will have the Conditional Formatting applied to (I used A1 to A10) and enter this formula in Conditional Formatting and select the formatting that you want to apply:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Change the A1 to the cell address at the top of your selected range.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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: 5
    Last Post: 12-31-2013, 01:44 AM
  2. [SOLVED] Conditional formatting - highlight cell if it's empty 2 working days before today
    By uhtfgy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-16-2013, 06:20 AM
  3. Replies: 4
    Last Post: 02-13-2013, 01:18 PM
  4. Conditional Formatting Cell < Today()
    By sagan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-21-2005, 11:05 AM
  5. conditional formatting ... shade cell ... older than today
    By Mirsten Choiple in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2005, 10:07 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