Conditional Formatting Cells based on date

Cracklehands

New Member
Joined
May 26, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am struggling to find the correct formula to conditionally format the cell, based on the date within that cell. For example, if in Cell B5 I enter the date 22/11/2022, then i want the following conditioning to change the cell fill colour:
22/11/2022 plus up to 9 months - cell is green
22/11/2022 plus 9-12 months - cell is amber
22/11/2022 plus 12 months+ - cell is red.

This is so I can track certificate date renewals. Once the certificate is issued (22/11/2022) it is in date and therefore green. In 9 months time, it will change to amber to highlight that it is coming up for reneweal. In 12 months time I want it to change to red to show it is overdue.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I've added the CF to 2 more cells (B7 & B9) just to show the effect on earlier dates.
Book1
ABC
3
4
522/11/2022
6
722/08/2022
8
922/05/2022
10
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B9Expression=AND(B9<>"",TODAY()<EDATE(B9,9))textYES
B9Expression=AND(B9<>"",TODAY()>=EDATE(B9,9),TODAY()<EDATE(B9,12))textYES
B9Expression=AND(B9<>"",TODAY()>=EDATE(B9,12))textYES
B7Expression=AND(B7<>"",TODAY()<EDATE(B7,9))textYES
B7Expression=AND(B7<>"",TODAY()>=EDATE(B7,9),TODAY()<EDATE(B7,12))textYES
B7Expression=AND(B7<>"",TODAY()>=EDATE(B7,12))textYES
B5Expression=AND(B5<>"",TODAY()<EDATE(B5,9))textYES
B5Expression=AND(B5<>"",TODAY()>=EDATE(B5,9),TODAY()<EDATE(B5,12))textYES
B5Expression=AND(B5<>"",TODAY()>=EDATE(B5,12))textYES
 
Upvote 0
Solution
I've added the CF to 2 more cells (B7 & B9) just to show the effect on earlier dates.
Book1
ABC
3
4
522/11/2022
6
722/08/2022
8
922/05/2022
10
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B9Expression=AND(B9<>"",TODAY()<EDATE(B9,9))textYES
B9Expression=AND(B9<>"",TODAY()>=EDATE(B9,9),TODAY()<EDATE(B9,12))textYES
B9Expression=AND(B9<>"",TODAY()>=EDATE(B9,12))textYES
B7Expression=AND(B7<>"",TODAY()<EDATE(B7,9))textYES
B7Expression=AND(B7<>"",TODAY()>=EDATE(B7,9),TODAY()<EDATE(B7,12))textYES
B7Expression=AND(B7<>"",TODAY()>=EDATE(B7,12))textYES
B5Expression=AND(B5<>"",TODAY()<EDATE(B5,9))textYES
B5Expression=AND(B5<>"",TODAY()>=EDATE(B5,9),TODAY()<EDATE(B5,12))textYES
B5Expression=AND(B5<>"",TODAY()>=EDATE(B5,12))textYES
That worked great, thank you,
 
Upvote 0

Forum statistics

Threads
1,215,756
Messages
6,126,692
Members
449,330
Latest member
ThatGuyCap

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