+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting Dates

  1. #1
    Registered User
    Join Date
    01-18-2021
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    8

    Conditional Formatting Dates

    Good afternoon.

    Please bear with me, I'm not the best with Excel.

    I have a problem where I need to be able to look at my spreadsheet and have the colours in the backgrounds quickly show me when a job is... in date, coming due or overdue. I need colours to change each time I open the spreadsheet so if I open it a week later they will change depending on the change in date.

    I have tried to use conditional formatting to show the dates in different colours. The problem I have is that sometimes the rules work and sometimes not, other times the cell is blank like there is no rules.

    These are the rules I am using at the moment are;

    Coming due - =AND($B2-TODAY()>=120,$B2-TODAY()<1)
    Due - =B2-TODAY()>120
    In date - =TODAY()-B2>0
    Not required - Blanks rule

    I have attached a sheet to show in action what I have.

    Any help would be appreciated.
    Attached Files Attached Files

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

    Re: Conditional Formatting Dates

    Welcome to the forum.

    It's not your CF rules. The two cells that don't work are not dates - they are text. You can check this by changing all date cells' formatting to general - real dates will show as a 5-digit serial number.

    Excel 2016 (Windows) 32 bit
    G
    H
    I
    J
    8
    31-06-2021
    9
    44177
    10
    44336
    11
    20-20-2021
    Sheet: Jobs
    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.

  3. #3
    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,929

    Re: Conditional Formatting Dates

    1st problem....not all your dates are real dates. G8 and J11 are actually text looking like dates - you need to change those
    2nd problem...you need to remove the absolute from the 1st formula =AND($B2-TODAY()>=120,$B2-TODAY()<1)
    3rd problem...The logic in that same formula looks off. You are testing for >= today+120 AND 1 day less than today. Take another look at that 1, I think it should be something like...
    =AND(B2-TODAY()<=120,$B2-TODAY()>1)
    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

  4. #4
    Registered User
    Join Date
    01-18-2021
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    8

    Re: Conditional Formatting Dates

    Quote Originally Posted by AliGW View Post
    Welcome to the forum.

    It's not your CF rules. The two cells that don't work are not dates - they are text. You can check this by changing all date cells' formatting to general - real dates will show as a 5-digit serial number.

    Excel 2016 (Windows) 32 bit
    G
    H
    I
    J
    8
    31-06-2021
    9
    44177
    10
    44336
    11
    20-20-2021
    Sheet: Jobs
    Thank you Ali. That turned out to be part of my problem indeed :D

  5. #5
    Registered User
    Join Date
    01-18-2021
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    8

    Re: Conditional Formatting Dates

    Quote Originally Posted by FDibbins View Post
    1st problem....not all your dates are real dates. G8 and J11 are actually text looking like dates - you need to change those
    2nd problem...you need to remove the absolute from the 1st formula =AND($B2-TODAY()>=120,$B2-TODAY()<1)
    3rd problem...The logic in that same formula looks off. You are testing for >= today+120 AND 1 day less than today. Take another look at that 1, I think it should be something like...
    =AND(B2-TODAY()<=120,$B2-TODAY()>1)
    Hi FDibbins,

    Thank you for the help, the problems are back under control again...

    I think the way I was thinking was one of the hinderances in this. I was thinking I wanted the number (B2-TODAY) to be greater than 120 and the other to be less than 1 so that would leave the numbers in between.

    I still had a problem with the coming due date not working elsewhere in the area then I removed both absolutes (they were there from me trying to fix the issue earlier) now everything seems to be running fine.

  6. #6
    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,929

    Re: Conditional Formatting Dates

    Happy to help

+ 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