+ Reply to Thread
Results 1 to 11 of 11

Help with conditional formatting based on date

  1. #1
    Registered User
    Join Date
    03-23-2013
    Location
    lincoln england
    MS-Off Ver
    2010
    Posts
    75

    Help with conditional formatting based on date

    I have had a play an used google but can't quite seem to get the right formula.

    I have a sheet which I type a date into column g, the conditional formatting formula would need to do the following...

    If date in G is 11 months or more ago from today's date then whole row with that date turns red.

    This is basically something that runs out after a year so when I type the date in I just need it to display with a red row a month coming up to expiry or over.

    Thanks in advance

    Daniel

  2. #2
    Registered User
    Join Date
    04-29-2012
    Location
    Florida, USA
    MS-Off Ver
    2010, 2013
    Posts
    34

    Re: Help with conditional formatting based on date

    Hi Daniel,

    With the range you want affected selected, go to Conditional Formatting and select New Rule, then select Use a formula... In the formula bar, enter the formula below:

    Please Login or Register  to view this content.
    Choose your formatting options and hit OK. That should do it.

  3. #3
    Registered User
    Join Date
    03-23-2013
    Location
    lincoln england
    MS-Off Ver
    2010
    Posts
    75

    Re: Help with conditional formatting based on date

    this works great, thanks!

  4. #4
    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
    53,048

    Re: Help with conditional formatting based on date

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    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

  5. #5
    Registered User
    Join Date
    03-23-2013
    Location
    lincoln england
    MS-Off Ver
    2010
    Posts
    75

    Re: Help with conditional formatting based on date

    If I wanted to drag this formula down a whole row how could I alter the formula so that if there is no data in the relevant cell it wont go red but stay white/normal.

    Daniel

  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
    53,048

    Re: Help with conditional formatting based on date

    1st, dont "drag" the formula down, just icrease the range it applies to (in the CF window)
    2nd, adjust the formula to this (not tested, but it should work)...

    =and($G2>0,$G2<=EDATE(TODAY(), -11))

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help with conditional formatting based on date

    =and($G2<>"",$G2<=EDATE(TODAY(), -11)) i did test it!
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    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
    53,048

    Re: Help with conditional formatting based on date

    I should have used <>"", go with Martin's suggestion

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Help with conditional formatting based on date

    Quote Originally Posted by FDibbins View Post
    I should have used <>"", go with Martin's suggestion
    Why?

    If you want to make it (almost) bulletproof use ISNUMBER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help with conditional formatting based on date

    agreed ,isnumber() would also ignore text but uses extra energy to push keys on my keyboard with

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Help with conditional formatting based on date

    Yeah, sometimes things don't have to be "bulletproofed".

    More often then not, keeping it simple, stupid will suffice.

+ 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