+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Formatting a Cell based on Date in another

  1. #1
    Registered User
    Join Date
    07-02-2009
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    4

    Exclamation Formatting a Cell based on Date in another

    I am currently working on a spreadsheet in Excel 07, I need to color code one cell based on the date in another cell.

    If the date in cell (A1) is greater than 7 days old, I need cell (D1) to turn Yellow, If greater than 10 days old, need cell (D1) to turn Red.

    Any help you can provide is greatly appreciated.

    Thanks,
    ~T
    Last edited by RunNWild; 07-02-2009 at 02:01 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formatting a Cell based on Date in another

    This is conditional formatting (you'll have to locate the menus in 2007).

    Highlight D1 and activate the conditional formatting controls:

    Condition1: Formula Is: =TODAY()-10>A1
    Format...pattern...red

    Condition1: Formula Is: =TODAY()-7>A1
    Format...pattern...yellow
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-02-2009
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formatting a Cell based on Date in another

    This is what is happening now:

    I created the following: =B6+7>TODAY()
    This is turning the cell red if the date in B6 is over 7 days from todays date, but I cannot figure out how to get the rows that have no date listed in the first cell not to turn red without entering a date. I only want this to execute if there is a date value in the first cell.
    I should be able to highlight the cell with the formula in and copy it down the column to have it active on as many rows as I wish, correct??

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formatting a Cell based on Date in another

    Try this:

    =AND(B6>0,B6+7>TODAY())

  5. #5
    Registered User
    Join Date
    07-02-2009
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formatting a Cell based on Date in another

    Same result, in rows with no date, the cell in the column with formula still changes color.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formatting a Cell based on Date in another

    You can experiment with these formulas in a regular cell without having to keep going into the CF windows. In a cell, enter the CF formulas and play around. If the formula returns TRUE, it will trigger the color in CF, if FALSE it will not.

    So, play with each piece of the formula, get each part to confirm TRUE/FALSE properly alone before you nest them together into an AND() statement. This is how I keep my sanity dealing with complex CF formulas.

    Once it is working in a cell, then put it into the CF matrix.

  7. #7
    Registered User
    Join Date
    07-02-2009
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formatting a Cell based on Date in another

    I finally got it to work correctly. Thanks for the help JBeaucaire. Here is what I ended up using.

    =IF(B6=0," ",B6+7>TODAY())

+ 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