+ Reply to Thread
Results 1 to 5 of 5

Conditional format for dates older than a specified date

  1. #1
    Registered User
    Join Date
    10-24-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    2

    Conditional format for dates older than a specified date

    Hello,

    I've got some data where I want to compare two dates and highlight the cell if the second date is three years older than the first date.

    For example:

    Last Active Info Submitted
    08/07/2015 14/02/2015
    23/05/2015 14/02/2015
    23/05/2015 06/10/2010
    15/08/2014 28/06/2012

    The cell with 06/10/2010 would be highlighted due to the date being three years older than 23/05/2015 but the other two dates wouldn't as they are less than three years older than the first date.

    Any help would be much appreciated.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,893

    Re: Conditional format for dates older than a specified date

    You could use this as the CF formula:
    =A2>DATE(YEAR(B2)+3,MONTH(B2),DAY(B2))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Conditional format for dates older than a specified date

    Hello,

    you can use a formula with the EDate function to quickly compare if a date in B1 is more than three years after a date in A1, like

    =B1>edate(A1,36)

    EDate adds months to a date and takes into account leap years. The result of the formula above is either a TRUE or a FALSE, so you can use this formula in a conditional format.

    cheers, teylyn

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,893

    Re: Conditional format for dates older than a specified date

    Duhhhh. I forgot about edate...

  5. #5
    Registered User
    Join Date
    10-24-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    2

    Re: Conditional format for dates older than a specified date

    Thank you so much, works a treat!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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