Conditional Formatting

Taryn A

New Member
Joined
Jun 29, 2013
Messages
38
I have an Excel workbook with a lot of dates that are colored coded as follows

Red indicates that the date in the cell is 13 months past the date entered in the cell

Orange indicates that the date in the cell is 1 year past the date in the cell

Green indicates its within the year of the date entered in the cell.

As the workbook is set up now i have to manually change the color of the cell.

i know there is a formula using conditional formatting that can automatically change the date but I'm not sure what that formula is. I will need this for most of the workbook. Can anyone help?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
are you comparing to todays date
if so then you could use today()

Assume in Cell A1

=A1<date(year(today()),month(today())-13,day(today()))
< DATE(YEAR(TODAY()),MONTH(TODAY())-13,DAY(TODAY()))
would show true for a date older than 13 months

=A1<date(year(today())-1,month(today()),day(today()))
< DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))
that older than a year

=A1 > DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))
younger than a year

do a stop if true

you need an = on one of those to include today a year ago - as we have used greater and less than - so depending on which colour you want today exactly a year tobe add
> =
or
< =


Excel Workbook
A
601/07/2013
722/06/2012
801/07/2011
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A61. / Formula is =A6Abc
A62. / Formula is =A6Abc
A63. / Formula is =A6>DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))Abc



</date(year(today())-1,month(today()),day(today()))
</date(year(today()),month(today())-13,day(today()))
 
Last edited:
Upvote 0
are you comparing to todays date
if so then you could use today()

Assume in Cell A1

=A1<DATE(YEAR(TODAY()),MONTH(TODAY())-13,DAY(TODAY()))
< DATE(YEAR(TODAY()),MONTH(TODAY())-13,DAY(TODAY()))
would show true for a date older than 13 months

=A1<DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))
< DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))
that older than a year

=A1 > DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))
younger than a year

do a stop if true

you need an = on one of those to include today a year ago - as we have used greater and less than - so depending on which colour you want today exactly a year tobe add
> =
or
< =


Sheet1

*A
601/07/2013
722/06/2012
801/07/2011

<COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 75px"></COLGROUP><TBODY>
</TBODY>

Conditional formatting

<TBODY>
<TD>
CellNr.: / ConditionFormat
A6Abc
A62. / Formula is =A6<DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))< td>[TD="bgcolor: #ffc000"]Abc
A63. / Formula is =A6>DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))Abc

<TBODY>
<TD>1. / Formula is =A6<DATE(YEAR(TODAY()),MONTH(TODAY())-13,DAY(TODAY()))< td>
</TBODY>
[/TD]

</TBODY>


Excel tables to the web >> Excel Jeanie HTML 4


</DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))
</DATE(YEAR(TODAY()),MONTH(TODAY())-13,DAY(TODAY()))[ QUOTE]
 
Upvote 0
Thanks so much for replying! Actually the date varies depending on when the physical was done. So it won't be "today's" date. Does that make sense?
 
Upvote 0
so instead of using today() just replace with the cell the date is in that you want to do the comparison with to trigger the colours
 
Upvote 0
so instead of using today() just replace with the cell the date is in that you want to do the comparison with to trigger the colours

Okay, I'm sorry for being so ignorant, but I'm trying to get this right...As an example, in one of the cells I have a test date of 3/26/10; based on today's date (current date) this cell should be coded red since the test date has exceeded 15 months. In another cell, I have a test of 4/24/12; based on today's date, this test date should be coded orange since the test date has exceeded 12 months. In another cell I have a test date of 4/17/13; based on today's date this cell should be coded green as it does not exceed 12 or 15 months from the test date of 4/17/13 entered in that particular cell.

I would like for the workbook to update in real-time. Is there something special I need to do to have that occur?

Do I have to enter the conditional formatting into each cell or can I highlight the cells I want to apply the formatting to so that I don't have to do it for each individual cell? Am I making any sense?

Thank you so much for your help and patience with me!
</SPAN>
 
Upvote 0
I apologize in advance if this gets posted twice, but when I hit submit reply it indicated I was logged out.

Okay, I'm sorry for being so ignorant, but I'm trying to get this right...As an example, in one of the cells I have a test date of 3/26/10; based on today's date (current date) this cell should be coded red since the test date has exceeded 15 months. In another cell, I have a test of 4/24/12; based on today's date, this test date should be coded orange since the test date has exceeded 12 months. In another cell I have a test date of 4/17/13; based on today's date this cell should be coded green as it does not exceed 12 or 15 months from the test date of 4/17/13 entered in that particular cell.

I would like for the workbook to update in real-time. Is there something special I need to do to have that occur?

Do I have to enter the conditional formatting into each cell or can I highlight the cells I want to apply the formatting to so that I don't have to do it for each individual cell? Am I making any sense?

Thank you so much for your help and patience with me!
</SPAN>
 
Upvote 0
you said in the orginal post
Red indicates that the date in the cell is 13 months past the date entered in the cell

now you are saying
As an example, in one of the cells I have a test date of 3/26/10; based on today's date (current date) this cell should be coded red since the test date has exceeded 15 months.

so instead of using -13 , you need -15
and put in the condition format in Red/Orange/Green order and stop if true

cell A6 = 3/26/10 - RED - 15 months
cell A7 = 4/24/12 - orange - 12 months
cell A8 = 4/17/13 - green - less than 12 months

see here is your examples and the formula used for conditional formatting

you can highlight all the cells you need to add the format to

Excel Workbook
ABCDEFGHIJK
2A1 DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))younger than a year
3
4
5
626/03/2010cell A6 = 3/26/10 - RED - 15 months
724/04/2012cell A7 = 4/24/12 - orange - 12 months
817/04/2013cell A8 = 4/17/13 - green - less than 12 months
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A61. / Formula is =A6Abc
A62. / Formula is =A6>DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))Abc
A63. / Formula is =A6Abc
 
Upvote 0
Thats OK - does it work for you now ?
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

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