+ Reply to Thread
Results 1 to 9 of 9

Conditional Formula comparing two dates in separate cells and coloring a third cell?

  1. #1
    Registered User
    Join Date
    03-13-2013
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2010
    Posts
    4

    Conditional Formula comparing two dates in separate cells and coloring a third cell?

    Cell E6 has a start date of 2/6/13 and cell F6 has an end date of 6/11/13. Cell G6 through G17 are the months for the year 2013. I'm trying to create a formula that makes the cells that fall within those dates turn yellow and I searched for the past two days through this forum and have been unsuccessful. Would anyone be able to help me with this?

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Conditional Formula comparing two dates in separate cells and coloring a third cell?

    Sample attached
    Attached Files Attached Files

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

    Re: Conditional Formula comparing two dates in separate cells and coloring a third cell?

    Quote Originally Posted by jmecobb View Post
    Cell G6 through G17 are the months for the year 2013.
    Are those just the month names as TEXT entries or are they dates?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    03-13-2013
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Conditional Formula comparing two dates in separate cells and coloring a third cell?

    Tony, they are actual dates.

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

    Re: Conditional Formula comparing two dates in separate cells and coloring a third cell?

    Try this...

    Select the *entire* range G6:G17 starting from cell G6.
    Cell G6 will be the active cell. The active cell is the
    one cell in the selected range that is not shaded. The
    formula will be relative to the active cell.

    Goto the Home tab>Styles>Conditional Formatting>Manage rules>New rule>Use a formula to determine which cells to format

    Enter this formula in the box below:

    =AND(G6>=E$6,G6<=F$6)

    Click the Format button
    Select the desired style(s)
    OK out

  6. #6
    Registered User
    Join Date
    03-13-2013
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Conditional Formula comparing two dates in separate cells and coloring a third cell?

    Hi Tony. Pretty cool, it worked but not 100% correctly. It colored all cell above/after month two. I attached the file if that makes it easier. Thank you for your help!
    Attached Files Attached Files

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

    Re: Conditional Formula comparing two dates in separate cells and coloring a third cell?

    OK, 1st thing...

    Set calculation to Automatic. In the sample file it's set to Manual.

    Use this formula in conditional formatting:

    =AND(MONTH(G$5)>=MONTH($E6),MONTH(G$5)<=MONTH($F6))

    Your dates on row 5 are the 13th of each month!

    1/13/2013
    2/13/2013
    3/13/2013
    4/13/2013
    etc
    etc

  8. #8
    Registered User
    Join Date
    03-13-2013
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Conditional Formula comparing two dates in separate cells and coloring a third cell?

    Tony, I bow to you. Thank you for your time and help. It works 100% perfectly and is exactly what I was looking for. Thanks again!

  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: Conditional Formula comparing two dates in separate cells and coloring a third cell?

    You're welcome. Thanks for the feedback!

+ 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