+ Reply to Thread
Results 1 to 12 of 12

Conditional Formatting Dates

  1. #1
    Registered User
    Join Date
    12-26-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel for 365
    Posts
    62

    Conditional Formatting Dates

    Hello,

    I'm looking to do the following & I have not found a post or instruction on how to accomplish this task.

    I have a 3 Col (A, B, C) Task Description, Target Date, Completion Date.

    If no date in Col C, & the date in Col B is 3 weekdays or less than today. Format Red. If there is a date in Col C. Format Gray
    If no date in Col C, & the date in Col B is between 4-7 weekdays less than today. Format Amber. If there is a date in Col C. Format Gray
    If no date in Col C, & the date in Col B is greater than 7 weekdays less than today. Format Green. If there is a date in Col C. Format Gray

    I have attached a simple workbook if that helps.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Conditional Formatting Dates

    what are we formatting - all 3 columns - just the c column

    For Grey - Then B5 is NOT BLank - but C5 will be
    SO one rule for that - would be
    =AND( B5<>"" , C5 = "" )

    RED
    If no date in Col C, & the date in Col B is 3 weekdays or less than today. Format Red.
    we can use NETWORKDAYS()

    But in your example all the dates are in future

    so just checking the example
    Often mix things up with terms like less than

    you would need 4 rules
    1 for grey
    1 for red
    1 for amber
    1 for green
    and we can use something like

    =Networkdays( B5, today() ) > 3

    today is 30th march 21
    Now the date in the cell B5 is 2nd April - so no colour
    RED would be colored in if the date in B5 was
    Friday 26/3 , Monday 29/3 , Tuesday 30/3

    If thats not right - what dates should flag
    is it for the future

    so 3 work days in future from future - is 31, 1, 2. in B5 = red
    so 4 - 7 days is 5,6,7,8 April in B5
    Last edited by etaf; 03-30-2021 at 03:12 PM.
    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.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting Dates

    Enter into conditional formatting in this order using New Rule>Use Formula...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Check off "Stop if True"
    See attached sheet. I assumed you wanted all the data in the row colored.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    12-26-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel for 365
    Posts
    62

    Re: Conditional Formatting Dates

    Wow, thank you this is perfect. You understood my question better than I asked it.

  5. #5
    Registered User
    Join Date
    12-26-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel for 365
    Posts
    62

    Re: Conditional Formatting Dates

    Hi ChemistB,

    I am trying to now assign a risk score based on the color coding. Is there a way to use maybe an IF statement to assign anything in RED with a 3, Amber a 2, & Green a 1, & finally 0 if there is a completion date in Col C.

    Thanks Again!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,740

    Re: Conditional Formatting Dates

    Thread marked as solved - remove the solved tag if you want further help.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    12-26-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel for 365
    Posts
    62

    Re: Conditional Formatting Dates

    Thank you Ali, sorry for slacking on my forum rules

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,740

    Re: Conditional Formatting Dates

    It's not a rule - it's just advice. When threads are marked solved,people tend to stop looking at them.

  9. #9
    Registered User
    Join Date
    12-26-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel for 365
    Posts
    62

    Re: Conditional Formatting Dates

    Feels like I am close. IN the attached workbook Gray, Green & Amber work using the below formula. Red does not it shows a 2 when it should show a 3. Any help would be appreciated.

    Please Login or Register  to view this content.
    Sorry, wasn't able to attach another workbook or update the one already attached.

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Conditional Formatting Dates

    you should be able to combine the rules into a nested IF
    green: =NETWORKDAYS(TODAY(),$B5)-1>7

    Amber: =AND(ISNUMBER($B5),NETWORKDAYS(TODAY(),$B5)-1<=7)

    Red: =AND(ISNUMBER($B5),NETWORKDAYS(TODAY(),$B5)-1<=3)

    Gray: =AND(ISNUMBER($B5),ISNUMBER($C5))
    RED with a 3, Amber a 2, & Green a 1, & finally 0
    something like - EDIT , like the conditional format - stop if true - the order is important
    as < = 7 - is also < = 3 - so the 7 needs to come last so its not overriding the 3

    =IF(C5 = "" , "" , IF( NETWORKDAYS(TODAY(),$B5)-1>7, 1, IF (AND(ISNUMBER($B5),NETWORKDAYS(TODAY(),$B5)-1<=3), 3, IF ( AND(ISNUMBER($B5),NETWORKDAYS(TODAY(),$B5)-1<=7) , 2 , 0 ))))

    =IF(C5="","",IF(NETWORKDAYS(TODAY(),$B5)-1>7,1,IF(AND(ISNUMBER($B5),NETWORKDAYS(TODAY(),$B5)-1<=3),3,IF(AND(ISNUMBER($B5),NETWORKDAYS(TODAY(),$B5)-1<=7),2,0))))
    Last edited by etaf; 04-02-2021 at 01:48 PM.

  11. #11
    Registered User
    Join Date
    12-26-2011
    Location
    San Diego, CA
    MS-Off Ver
    Excel for 365
    Posts
    62

    Re: Conditional Formatting Dates

    Thank you etaf! Very much appreciated!

  12. #12
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Conditional Formatting Dates

    you are welcome

+ 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-03-2020, 01:45 PM
  2. Conditional formatting using dates and using dates without years
    By dcef79 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-15-2014, 05:35 AM
  3. Replies: 11
    Last Post: 05-04-2014, 08:28 PM
  4. [SOLVED] Conditional Formatting Due dates and Completed Dates
    By shansen79 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-30-2014, 01:33 PM
  5. Conditional Formatting with approaching due dates and completed dates
    By rogernation in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-13-2013, 04:12 PM
  6. Replies: 4
    Last Post: 08-29-2013, 11:23 AM
  7. [SOLVED] Conditional Formatting of: dates within 1 month and dates before today.
    By Luke Smith in forum Excel General
    Replies: 5
    Last Post: 06-18-2013, 07:29 AM

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