April 23, 2015
Hi there, hope everyone is safe and well.
I am here with my dunce hat on again! I am trying to figure out what I imagine will be a simple formula to be used in conditional formatting but I can't get it.
I have a cell with the date a person took a training course. I want to have a formula that will change the cell fill and font when "today's" date is between 1065 and 1095 from the cell value, i.e. the date they took the training course. I need a second formula to do the same thing but when "today's" date is between 1035 and 1095 from the cell value.
Can anyone help me?
Thanks,
Alan
April 23, 2015
Hi Phil,
Thanks for the note and apologies for the confusing message. The values I listed are days, so the cell value will be the date they took the training course, I want the cell format to change when todays date is between 1065 and 1095 days after they took the training course. A basic way of flagging when a course is close to its renewal date.
I hope that is clearer, I have added workbook that has my attempts to do this shown in row 3, cells D3 to AI3.
Many thanks,
Alan
VIP
Trusted Members
December 7, 2016
Hello Alan,
You can use the DAYS function to get the number of days between start and end date, wrap that in an IF together with an AND statement to check if the number of days are between the two intervals. Example as of below.
L1 = The end date to check against.
G3 = The start date to check against.
Formula to use as the Conditional Format formula for G3 (I assume it is the date field you want to highlight).
=IF(AND(DAYS($L$1,G3)>=1065,DAYS($L$1,G3)<=1095),TRUE,FALSE)
If you intend to have the second conditional check on same cells then you need to specify the order of these two rules, the top rule is the active one when both are true.
Br,
Anders
April 23, 2015
Hi Anders,
Many thanks for the help with this one. I did try to use the formula you provided but I could not get it to generate the desired result. I think I must be missing something in the logic of the problem. I have attached another copy of the file to try to highlight what I feel I can't quite grasp.
I have added your formula in the conditional format dialog and applied to cell L3 only. I am going to write out what I am trying to achieve again here in the hope that it might highlight to you where I am going wrong:rn
The date in cell L3 is 14th Aug 2017, this is the date of a training course.
The training course is due for renewal 3 years after 14th Aug 2017, so basically 20th Aug 2020, or 1095 days after the 14th Aug 2017.
I need a conditional format formula that will change the fill of the cell when "todays" date is 1065 days since 14th Aug 2017, i.e. 30 days before the actual renewal date.
I hope that makes sense - any and all advice welcome!
Alan
VIP
Trusted Members
December 7, 2016
Hello Alan,
One thing we don't have here is how to highlight the cell when we are past those 1095 days, i.e. the renewal period has ended. In attached file I have adjusted the CF formula for L3, it now checks against the date in L3 and not in G3. I have also added two more rules for that cell, giving each a different background colour, so the formula can be simplified as we now no longer need to check if today's date is in between.
Rule 1: =DAYS($L$1,L3)>=1095 <-- Red background colour
Rule 2: =DAYS($L$1,L3)>=1065 <-- Yellow background colour
Rule 3: =DAYS($L$1,L3)>=1035 <-- Green background colour
So just play around and give different date in L1 as today's date.
I hope this helps you to get closer to what you want to achieve.
Br,
Anders
Answers Post
April 23, 2015
Hi Anders,
Thanks so much for this, it works! I am happy to leave the cells when we are past those 1095 days without shading. The idea is we catch and initiate the training required as we near the renewal dates so we shouldn't have anyone with a training requirement outstanding beyond the 1095 days.
Thanks again,
Alan
1 Guest(s)