Conditional formatting after a time period relative to the date in a cell

daithiboy

Board Regular
Joined
Jul 1, 2016
Messages
77
Hello All,

I have a sheet with a list of names in column A and the dates that they attended training in column B (and subsequent for different training types).

As, each person has to redo their training after two years, I was hoping that I could get the cells in column B to go red once two years has passed based on the various dates in column B.

NameTraining
John12/02/2015
Dave05/12/2013
Mike08/06/2012
Bill09/03/2016

<tbody>
</tbody>

Any suggestions? I really don't know how to proceed.

VBA or some quirk of general Conditional Formatting is fine with me!

Many thanks in advance,
Dave
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Assuming the names are in column A and the dates in column B, select column B and then Conditional Formatting > New Rule > Use a formula to determine which cells to format

Enter this as the formula:

=AND(ISNUMBER(B1),DATEDIF(B1,TODAY(),"Y")>=2)

Set the appropriate format (e.g. fill red) and it should identify Dave and Mike as overdue dates.

WBD
 
Upvote 0
Many thanks Wideboydixon, that worked great. Do you mind if I ask if it is possible to expand it so the date ranges <1.5(years) are formatted Green, 1.5 - 2 Orange and >=2 is red?

I've tried using three different rules for the time frames but the formula will have the orange rule (>=1.5) overruling the red one (>=2). I've tried moving them up and down the rule order but it seems that whichever is higher up the order wins out.

I hope that is clear. The first solution works great and this would just be some window dressing that I am curious about.

Many thanks again,
Dave
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,813
Members
449,469
Latest member
Kingwi11y

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top