+ Reply to Thread
Results 1 to 10 of 10

Conditional formatting formulas

Hybrid View

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    Windsor, Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Conditional formatting formulas

    Hello, I have a training grid I have set up to track everything for my employees and have set up conditional formatting to draw my attention to upcoming due dates/license expiration dates, anniversaries, etc.

    In the cell is the date of the current certificate. Depending on the course (some are annual, tri-annual or quinquennial), I need to have four seperate conditions for easier recognition. Let's use tri-annual as an example.

    1. If the date in the cell is greater than 3 years I want the cell highlighted in red
    2. If the date is less than 3 years but more than a year from expiry I'd like it green.
    3. If the date is within a year of expiry I'd like it yellow.
    4. If the date is within 60 days of expiry, I'd like it orang.

    The problem I'm having is every employee will have a different date of expiry...

    Any thoughts?

    Thank you in advance.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting formulas

    Hi,

    Assuming date is in A2 and expiry date is in B2 then enter the following in A2 and apply them to A2:A?? whatever the last row is.

    Red CF
    Formula: copy to clipboard
    =$B2>DATE(YEAR($A2)+3,MONTH($A2),DAY($A2))


    Green CF
    Formula: copy to clipboard
    =AND($B2>DATE(YEAR($A2)+1,MONTH($A2),DAY($A2)),$B2<DATE(YEAR($A2)+3,MONTH($A2),DAY($A2)))


    Yellow CF
    Formula: copy to clipboard
    =$B2<DATE(YEAR($A2)+1,MONTH($A2),DAY($A2))


    Orange CF
    =$B2-$A2<60
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-10-2014
    Location
    Windsor, Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional formatting formulas

    Do I need to have an expiry column? Could I just incorporate the formula based on the data in the cell?

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting formulas

    You are comparing two dates. What are they and where are they on the worksheet?

    You were telling us there is an expiry date in your original post so I'm totally confused now that you suggest you don't now need an expiry date.

  5. #5
    Registered User
    Join Date
    02-10-2014
    Location
    Windsor, Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional formatting formulas

    actually that's wrong again...

    it would be 2 years from that date = yellow, 3 years less 60 days = orange...

  6. #6
    Registered User
    Join Date
    02-10-2014
    Location
    Windsor, Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional formatting formulas

    sorry maybe this will better explain...

    the date in the column is the date they received the certificate... therefore the formula will have to be based on that date... 3 years from that date = expired, 1 year from that date = yellow, 60 days from that date = orange, and anything else = green

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting formulas

    Yes but what are you comparing?

    OK you have the date they received the certificate, what are you comparing that with in order to determine what the time difference is?

    We're dealing with a conditional format here which implies you're making a comparison and painting the cell a different colour based on the result of the comparison.

    Maybe you'd better upload your workbook so that we stop guessing what it looks like and what you have in mind. Add some typical figures and note what colour you expect specific cells to be.

  8. #8
    Registered User
    Join Date
    02-10-2014
    Location
    Windsor, Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional formatting formulas

    I'm comparing the date in the cell to the appropriate category. In the example I used the expiry was 3 years from that date.

    I've attached the workbook... feel free to look it over. I apologize if I'm not clear

    I have been working on the First Aid column that expires 3 years from the date in the cell...
    Attached Files Attached Files
    Last edited by danlfixt; 02-10-2014 at 02:40 PM. Reason: added material

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting formulas

    OK So you're comparing with today's date. It might have been helpful if you had mentioned that in the original post.

    Use the original formulae I gave you starting in B2, but instead of where I mention A2, substitute B2 instead, and where I use stuff like Year(A2) substitute Year(Today())

  10. #10
    Registered User
    Join Date
    02-10-2014
    Location
    Windsor, Canada
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional formatting formulas

    ok great I'll try that... ty so much...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Conditional Formatting and Formulas
    By lea313 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-19-2013, 07:18 AM
  2. Excel 2007 : formulas with conditional formatting
    By drj73 in forum Excel General
    Replies: 4
    Last Post: 03-07-2012, 09:09 AM
  3. Conditional formatting using formulas
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2011, 10:27 PM
  4. Replies: 1
    Last Post: 09-14-2010, 03:45 AM
  5. Conditional Formatting using formulas
    By williams77 in forum Excel General
    Replies: 1
    Last Post: 02-25-2010, 05:58 AM

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