+ Reply to Thread
Results 1 to 7 of 7

Filling cells with 3 different colors based on date in cell and todays date

  1. #1
    Registered User
    Join Date
    07-21-2009
    Location
    Fort Rucker, Alabama
    MS-Off Ver
    Excel 2007
    Posts
    3

    Filling cells with 3 different colors based on date in cell and todays date

    I'm trying to create a maintenance tracker. I want to put a date of last completion in a cell and have it highlighted green indicating it is good and for the cell to turn yellow after 15 days and red after 30. I'm unsure on how to do this and i'm pretty new to excel. I use excel 2007. any help would be appreciated.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Filling cells with 3 different colors based on date in cell and todays date

    You need use Conditional Formatting in the cell.

    With the range of cells selected, click on Conditional Formatting on the Home tab of the ribbon menu.

    Use these formulas for the three conditions, making sure to adjust the cell references for your workbook.

    =B2-A2<15
    =B2-A2>=15,B2-A2<30
    =B2-A2>30

    My example assumes a start date in A2 and a completion date in B2.

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Filling cells with 3 different colors based on date in cell and todays date

    Hello Chinookcrew, welcome to the forum.

    This site should help you through Conditional Formatting. Refer to the Excel 2007 steps in each example.

    http://www.contextures.com/xlcondformat03.html#Expiry

  4. #4
    Registered User
    Join Date
    07-21-2009
    Location
    Fort Rucker, Alabama
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Filling cells with 3 different colors based on date in cell and todays date

    I'm sorry but niether one of these helped me. i guess i need to re word the question.What is the easiest way to change a color of a cell based on it's contents? This is what i want to happen in a single cell:
    -if the date in, lets say F2 is 22july09, is equal to todays date but less than 15 days old then i want the cell to turn green
    -if the date in cell f2 is older than 15 days of todays date but less than 30 i want the cell to turn yellow
    -if the date in cell f2 is 30 days or older then i want the cell to turn red.
    i've been racking my brain with this and i'm not good enough to use macros or VBA and no matter what formula i put in conditional formatting it doesn't work.
    also if the cell is blank then i don't want any color there at all

  5. #5
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Filling cells with 3 different colors based on date in cell and todays date

    Use these formulas and in the order given to establish the priority for the CF.

    Green =OR(F2=TODAY(),TODAY()-F2<=15)
    Yellow =TODAY()-F2<=30
    Red =TODAY()-F2>30

  6. #6
    Registered User
    Join Date
    07-21-2009
    Location
    Fort Rucker, Alabama
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Filling cells with 3 different colors based on date in cell and todays date

    that works great so how do i do this to multiple cells

  7. #7
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Filling cells with 3 different colors based on date in cell and todays date

    Copy the cell that has the CF.

    Select the range of cells for which you wish to have same CF, then choose Paste Special Formats.

    Note that this will copy the conditonal format as well as all other formatting from the source cell.

    If the other cells are in the same column and you simply want to extend the CF to them, then activate the source cell and drag down the column using the fill handle.

    One last method:
    When initially setting up the CF. select the entire range of cells that are to have the CF, making sure the first cell in the range is the active cell. Then just enter your CF as you would for a single cell and it will apply to all of the cells in the selected range.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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