+ Reply to Thread
Results 1 to 8 of 8

Highlight Rows Based on Date Range Using Static Date and Current Date

  1. #1
    Registered User
    Join Date
    08-30-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2010
    Posts
    6

    Highlight Rows Based on Date Range Using Static Date and Current Date

    Hello,

    I'm trying to highlight rows based on the difference between a date and time within a cell in the row and the current date and time.

    (All data is to be calculated during working days, M-F, and working hours, 8-5)

    Yellow - Difference between A1 and current date and time is less than or equal to 7 working days
    Red - Difference between A1 and current is greater than or equal to 8 working days

    Thank you.

  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
    52,933

    Re: Highlight Rows Based on Date Range Using Static Date and Current Date

    Hi, welcome to the forum

    I suggest you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    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
    08-30-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Highlight Rows Based on Date Range Using Static Date and Current Date

    Book1.xlsx

    Attached is the sample book. I would like the conditional formatting to look at the date in column H, subtract is from NOW() and highlight the row based on the following:

    Green: <7 business days
    Yellow: 7-14 business days
    Red: >14 business days

    Thank you.

  4. #4
    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
    52,933

    Re: Highlight Rows Based on Date Range Using Static Date and Current Date

    I think you mean TODAY()? NOW() includes the time as well as the date

  5. #5
    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
    52,933

    Re: Highlight Rows Based on Date Range Using Static Date and Current Date

    I think these are the rules you need...
    =NETWORKDAYS(H2,TODAY())>14
    =NETWORKDAYS(H2,TODAY())>=7
    =NETWORKDAYS(H2,TODAY())<7

  6. #6
    Registered User
    Join Date
    08-30-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Highlight Rows Based on Date Range Using Static Date and Current Date

    Thank you. Won't that only change H2? I need it to change the whole row and make that change for the entire sheet.

  7. #7
    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
    52,933

    Re: Highlight Rows Based on Date Range Using Static Date and Current Date

    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =NETWORKDAYS($H2,TODAY())>14

    Repeat 3 and 4 for the other 2 rules

  8. #8
    Registered User
    Join Date
    08-30-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Highlight Rows Based on Date Range Using Static Date and Current Date

    Thank you! That was very helpful.

    Is there a formula to apply for blank cells so it doesn't apply a color? I have rows 2-500 selected for the formatting, but I only have initial data in the first 5 rows with more to be added as time goes on. The remaining 495 rows are red.

+ 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. Calculate next due date based on start date frequency and current date
    By ironoverload in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-09-2014, 07:08 AM
  2. [SOLVED] Selecting data from a date range based on the current date
    By ian-sheridan in forum Excel General
    Replies: 12
    Last Post: 06-20-2013, 11:38 AM
  3. [SOLVED] To count the number of rows based on date and check how old the row is from current date.
    By raovv in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-04-2013, 11:45 AM
  4. Replies: 6
    Last Post: 01-16-2012, 02:39 PM
  5. highlight rows with current date entry
    By arcware in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-18-2008, 06:44 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