+ Reply to Thread
Results 1 to 4 of 4

Adding to TODAY() in a conditional format rule

  1. #1
    Registered User
    Join Date
    01-25-2011
    Location
    Newcastle upon Tyne, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Adding to TODAY() in a conditional format rule

    Hi,
    please forgive any mistakes as I am not massively proficient in this but...

    I am trying to use a conditional format 3-colour scale to colour dates for when things such as insurance policies are due for renewal. I would like any cells with a date of within 2 months of today to be red, 2-3 months to be orange or whatever, and more than 3 months to be green.

    I have tried to set the rule using formulas but cannot get it to work - it accepts the formulas but no colours appear.

    The three formulas I used were:

    1. =TODAY() - this worked fine when the other 2 were set to percentages

    2. =DATE(YEAR(DATEVALUE("TODAY()")),MONTH(DATEVALUE("TODAY()"))+2,DAY(DATEVALUE("TODAY()")))

    3. =DATE(YEAR(DATEVALUE("TODAY()")),MONTH(DATEVALUE("TODAY()"))+3,DAY(DATEVALUE("TODAY()")))

    The only other alternitive I tried was setting cells to have those values and trying to get the formula to use them, but excel told me you cannot "use relative references in conditional formatting for colour scales".

    Is it just not possible to do this? or are my formulas not doing what I think they are?

    any help would be much appreciated!

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Adding to TODAY() in a conditional format rule

    Hello & Welcome to the Board,

    Might this help...

    http://www.xldynamic.com/source/xld.CF.html#due
    HTH
    Regards, Jeff

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Adding to TODAY() in a conditional format rule

    You can use DATEDIF for this, i.e. for green condition

    =DATEDIF(TODAY(),A1,"m")>=3

    for orange

    =DATEDIF(TODAY(),A1,"m")>=2

    then all remaining dates should be red so you can use a formula that will identify any remaining dates not formatted by the previous 2 conditions, i.e.

    =ISNUMBER(A1)

    format red

    see attached

    Press F9 to re-generate random dates
    Attached Files Attached Files
    Audere est facere

  4. #4
    Registered User
    Join Date
    01-25-2011
    Location
    Newcastle upon Tyne, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Adding to TODAY() in a conditional format rule

    many thanks for those responses!
    I don't know why but using the "use a formula to determine which cells to format" rather than the "format cells based on value" option hadn't occured to me even though I was trying to use a formula!

    Many thanks again!

+ 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