+ Reply to Thread
Results 1 to 5 of 5

Conditional Formatting - time based

  1. #1
    Registered User
    Join Date
    08-03-2015
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    38

    Conditional Formatting - time based

    Hello,

    I have a spreadsheet where I am tracking a project with different timelines, and I would like to figure out a conditional format to make it highlight certain cells based on the due date.

    I would like these cells to get highlighted a certain color when the due date is next week. Perhaps I can have a few different colors depending on the day.

    I have attached a spreadsheet with a simple example of two columns.

    If the date in Column B is this coming Friday, I would like Column A to be Red.
    If the date in Column B is next Friday, I would like Column A to be Yellow.
    If the date in Column B is the following Friday, I would like Column A to be Green.
    If the date in Column B happens to be further than 2 Friday's out, then I would want Column A to be Blue.

    Regardless of the due date, though, I do want Column A to be highlighted if the cell in Column B is not blank; which based on the above, it would be Blue if it was far out in the future.

    How can I do this?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Conditional Formatting - time based

    Your example data implies that each date will either be blank or ALWAYS be a Friday.
    But your description says "this coming Friday"

    So will your dates always be a Friday (as per your example) or could they be any date?
    Last edited by Special-K; 08-31-2017 at 06:09 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Conditional Formatting - time based

    Try this

    Select A2:A5

    Conditional Formatting
    New Rule
    Use a formula to determine...

    =ABS(B2-(TODAY()+7-WEEKDAY(TODAY()+7-6)))<7
    format as red

    =AND(B2>TODAY()+7,ABS(B2-(TODAY()+7-WEEKDAY(TODAY()+7-6)))<14)
    format as yellow

    =AND(B2>TODAY()+14,ABS(B2-(TODAY()+7-WEEKDAY(TODAY()+7-6)))<21)
    format as green

    =B2-ABS(B2-(TODAY()+21-WEEKDAY(TODAY()+7-6)))>=21
    format as blue

  4. #4
    Registered User
    Join Date
    08-03-2015
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    38

    Re: Conditional Formatting - time based

    Quote Originally Posted by Special-K View Post
    Your example data implies that each date will either be blank or ALWAYS be a Friday.
    But your description says "this coming Friday"

    So will your dates always be a Friday (as per your example) or could they be any date?
    Yes, it will almost always be on a Friday... but if for some reason the work week ends at Thursday then that week it will be on a Thursday. Basically I just want the cells to automatically change colors depending on if it is due 1) next week (red), 2) the week after (yellow), 3) the following week (green), or 4) further out that 2 weeks (blue).
    Last edited by rosethorn5; 09-01-2017 at 03:03 PM.

  5. #5
    Registered User
    Join Date
    08-03-2015
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    38

    Re: Conditional Formatting - time based

    Quote Originally Posted by Special-K View Post
    Try this

    Select A2:A5

    Conditional Formatting
    New Rule
    Use a formula to determine...

    =ABS(B2-(TODAY()+7-WEEKDAY(TODAY()+7-6)))<7
    format as red

    =AND(B2>TODAY()+7,ABS(B2-(TODAY()+7-WEEKDAY(TODAY()+7-6)))<14)
    format as yellow

    =AND(B2>TODAY()+14,ABS(B2-(TODAY()+7-WEEKDAY(TODAY()+7-6)))<21)
    format as green

    =B2-ABS(B2-(TODAY()+21-WEEKDAY(TODAY()+7-6)))>=21
    format as blue
    This unfortunately did not work. Please see updated attached spreadsheet. All the cells are blue, even though they should be either red, yellow and green according to the dates.
    Attached Files Attached Files

+ 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. Conditional formatting of formula based time
    By roland willems in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-24-2017, 03:02 PM
  2. Time-Based Conditional Formatting With Offset
    By joseph.wolfenberger in forum Excel General
    Replies: 1
    Last Post: 06-21-2016, 04:04 PM
  3. conditional formatting based on time difference
    By arindamsenaxa in forum Excel General
    Replies: 4
    Last Post: 11-28-2014, 10:58 AM
  4. Conditional Formatting - Based on Time
    By haroon284 in forum Excel General
    Replies: 6
    Last Post: 09-08-2014, 04:47 AM
  5. Replies: 5
    Last Post: 11-27-2013, 06:04 PM
  6. Conditional Formatting Based on Time Window
    By sdoremus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2008, 04:48 PM
  7. Conditional formatting based on time
    By sharkey in forum Excel General
    Replies: 2
    Last Post: 12-24-2007, 02:13 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