+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting date cells based on entry in adjacent cell

  1. #1
    Registered User
    Join Date
    09-26-2011
    Location
    Geneva, Switzerland
    MS-Off Ver
    Excel 2007
    Posts
    5

    Conditional formatting date cells based on entry in adjacent cell

    Hello everyone!

    Thanks in advance for helping me out. I've looked at similar posts but none of them were meeting my needs (apparently).

    So...

    In L2 I have a date and I want this cell to be green if the date is bigger than 30 days, yellow if between 0 to 29 days and red if in the past. This I can do! but...

    I also want the cell to change color based on the choice I will plug from the pick list I've created in M2, which are green if received on time, yellow if received late and red if not received.

    Basically I need the 1st conditional formatting to apply as long as M2 is blank but when M2 has data in it I want this to offset the color .

    Here are the formulas I have in my cell now for the basic coloring based on the dates:

    =L2-TODAY()>30 green
    =L2-TODAY()>=1 yellow
    =L2-TODAY()<=0 red

    I really hope you guys will be able to help me enter that new parameter from M2 in my formula!

    Thanks
    Marco (Geneva, Switzerland)
    Last edited by koudesak; 09-27-2011 at 04:19 AM.

  2. #2
    Forum Contributor
    Join Date
    08-01-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    182

    Re: Conditional formatting date cells based on entry in adjacent cell

    Hi Marco,

    Welcome to the forum...

    Hope this helps

    =and(M2="",L2-TODAY()>30)

  3. #3
    Registered User
    Join Date
    09-26-2011
    Location
    Geneva, Switzerland
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Conditional formatting date cells based on entry in adjacent cell

    Hi inayat,

    I've just tried but the cell L2 is still red, as if the value in that cell (5-Jan-11) and its conditional formating would not take in account M2.

    The conditional formatting that is below should only apply when M2 is blank:

    =L2-TODAY()>30 green
    =L2-TODAY()>=1 yellow
    =L2-TODAY()<=0 red

    Then if not blank I want to add the following to the conditional formatting:

    received on time = green
    received late = yellow
    not received = red

    Not sure if that helps changing the perception of what could be the formula.

    Many thanks!
    Marco

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional formatting date cells based on entry in adjacent cell

    You want to set up rules in this order, and check the box that says "Stop If True" for the first three rules.
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Registered User
    Join Date
    09-26-2011
    Location
    Geneva, Switzerland
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Conditional formatting date cells based on entry in adjacent cell

    Hello 6StringJazzer,

    Thanks a lot for the very detailed explanation, it works perfectly! I feel like I'm mastering excel now!

    Really appreciate the help.

    Kind regards,
    Marco

+ 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