+ Reply to Thread
Results 1 to 4 of 4

I need to highlight a cell when a date is 2 and 1 motths away from being half a year

  1. #1
    Registered User
    Join Date
    02-27-2015
    Location
    Sydney, Australia
    MS-Off Ver
    2013
    Posts
    1

    I need to highlight a cell when a date is 2 and 1 motths away from being half a year

    Hello everyone!

    So I work in a company where we sometimes employ people on their Work and Travel visas. In Australia it means that they can't work for one employer for more than 6 months so I would like to track that. Currently I use this formula to track the length of service:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    which gives me:

    0 years 3 months 9 days

    What I would like to add is: automatically highlight the cell with the name in yellow when there's 2 months left until 6 months of service and in red when 1 month or less left till 6 months of service and that should happen only if this person has WT (work and travel) in their Notes column. Currently I can't figure it out. Could you help me with that please?

  2. #2
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: I need to highlight a cell when a date is 2 and 1 motths away from being half a year

    It will be the same formula essentially. Basically you will highlight the range of names, then put in the formula that calculates the condition you wish to have it set under. Make sure you are basing it on the first persons date or first date/header relative to the range you selected. Example - If I was to have names down Col A and Dates Started in B and Date Expires in C then I would highlight the range of names lets say $A$1:$A$100 and then go to conditional formatting and add a formula based condition. This formula would then look something like =($C1-Today())<=30 when this is true apply the formatting I select. This is to say if the date in C1 is less than or equal to today apply format. Now take note that I am not locking the row as I want the CF to be relative to repeat this logic down all of C applying formatting to my selected Range of A1 - A100. If you are still having issues post a sample file and I or someone here will be able to elaborate.
    -If you think you are done, Start over - ELeGault

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,652

    Re: I need to highlight a cell when a date is 2 and 1 motths away from being half a year

    With C16 contains "WT"

    C18 is start date

    =>EDATE(C18,6) is date of 6 months later

    and months counted from today:
    =DATEDIF(TODAY(),EDATE($C$18,6),"YM")

    with WT criteria:
    =(C16="WT")*DATEDIF(TODAY(),EDATE($C$18,6),"YM")=2

    choose format name as yellow.
    Quang PT

  4. #4
    Registered User
    Join Date
    05-25-2010
    Location
    Florida
    MS-Off Ver
    Excel 2009
    Posts
    39

    Re: I need to highlight a cell when a date is 2 and 1 motths away from being half a year

    Alternative solution using the one column with your current formula):
    Using conditional formatting (entire column):
    =IF(AND(VALUE(TRIM(MID(A1,8,3)))<=0,B1="WT",(VALUE(LEFT(A1,1)))=0),"TRUE","FALSE") [set fill to red]
    =IF(AND(VALUE(TRIM(MID(A1,8,3)))<=1,B1="WT",(VALUE(LEFT(A1,1)))=0),"TRUE","FALSE") [set fill to yellow]

    *Replace A1 and B1 with the applicable cells
    **If it is exactly 2 months then it will still be white and if it is exactly 1 month it will still be yellow (you can add an AND statement to fix that)

+ 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. Replies: 2
    Last Post: 11-18-2013, 12:22 PM
  2. Need to convert a date to half year convention then count the months...
    By Milkie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-14-2013, 06:05 PM
  3. Replies: 2
    Last Post: 12-18-2012, 11:18 AM
  4. Replies: 5
    Last Post: 08-22-2012, 05:06 PM
  5. Replies: 2
    Last Post: 06-11-2012, 06:08 PM

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