+ Reply to Thread
Results 1 to 9 of 9

Changing cell colour within IF statements

  1. #1
    Registered User
    Join Date
    01-20-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Changing cell colour within IF statements

    Hi,
    I have a spreadsheet with a master worksheet containing columns that list staff names and the training completed and forklift licenses obtained and when those licenses expire.
    Another worksheet refers to that master sheet and using nested IF statements populates the cells with the names of staff who have obtained their forklift licenses and when the licenses expire.
    Is there any way that I can expand the IF statements (or add something else) to change the cell colour depending on how close each cell name is to the license expiry date? e.g. change the cell colour to orange if the expiry date is within 6 weeks from today's date, red if within 3 weeks, and so on.

  2. #2
    Valued Forum Contributor
    Join Date
    05-19-2010
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Changing cell colour within IF statements

    you can use conditional format >>> if you could post a small example of your file would help

  3. #3
    Registered User
    Join Date
    01-20-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Changing cell colour within IF statements

    Thanks for your reply. I've attached a small example to look at.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Changing cell colour

    Hi, you can use conditional formatting.
    With expiry date in column B, select the cells you want formatted and apply these conditions
    =$B2-today()<=21
    =$B2-today()<=42
    For each condition, you choose what color should be used when condition is true.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    05-19-2010
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Changing cell colour within IF statements

    Sorry it took so long to get back to you >> I was called away
    click B10 go conditional format / formula is
    Please Login or Register  to view this content.
    format your color add
    Please Login or Register  to view this content.
    format your color
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-20-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Changing cell colour within IF statements

    Fantastic - works a treat thank you. Now tell me is there a way to copy this conditional rule across multiple rows without doing each cell individually? I would have say 4 conditional formats per cell (4 different colours for different upcoming lead times to license expiration date) so across a thousand rows it would save me heaps of effort. Thanks again for bothering to help out.

  7. #7
    Registered User
    Join Date
    01-20-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Changing cell colour within IF statements

    I did apply the formats to a range inside the formatting rules management area, and that doesn't seem to be working very well now. I did try ticking and unticking the 'stop if true' boxes but no difference; the different colour format rules are only working ad hoc - that is, some of the cells colouring correctly as per the formula and others aren't. Very confusing.
    Last edited by Paul; 01-20-2012 at 05:36 PM.

  8. #8
    Valued Forum Contributor
    Join Date
    05-19-2010
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Changing cell colour within IF statements

    This may work better
    Please Login or Register  to view this content.
    and format colour
    Please Login or Register  to view this content.
    and format colour
    now click B10 Copy then highlight were you want cells formated -- go Paste special / click FORMATS then OK
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-20-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Changing cell colour within IF statements

    Thanks Guys - terrific help!

+ 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