+ Reply to Thread
Results 1 to 3 of 3

Highlighting dates older than 4 years

  1. #1
    Registered User
    Join Date
    04-03-2010
    Location
    Bognor
    MS-Off Ver
    Excel 2003
    Posts
    2

    Highlighting dates older than 4 years

    Hello, I have an excel sheet with a list of dates, and what I'd like to know is how I can colour/highlight the dates more than four years ago, preferably to the month. I've tried to use conditional formatting to do this but failed, so any help would be greatly appreciated.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Highlighting dates older than 4 years

    Assume dates are in A1:A100, with said range highlighted having selected A1 first - applying a Conditional Formula rule of:

    =DATEDIF(A1,TODAY(),"y")>4

    with format set as appropriate should work though the 4 years will be based on the day

    If you want to disregard the day of the month then you could adjust the above accordingly, ie::

    =DATEDIF(A1-DAY(A1)+1,TODAY()-DAY(TODAY())+1,"y")>4

    In the above both dates (criteria and current date) are normalised to 1st of Month before duration is calculated.

    Were A1 5th April 2005 the first DATEDIF formula would 4 and thus False (ie 4 not > 4) whereas the latter would return 5 and thus the cell would be formatted per the config applied.

    (modify ranges to suit of course)
    Last edited by DonkeyOte; 04-03-2010 at 12:19 PM. Reason: added ex. re: A1

  3. #3
    Registered User
    Join Date
    04-03-2010
    Location
    Bognor
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Highlighting dates older than 4 years

    Thanks very much DonkeyOte, I'll give that a go

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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