Conditional Formatting Question

Vladogs

New Member
Joined
May 6, 2023
Messages
6
Office Version
  1. 365
Good day guys,

I have a bunch of dates in a column. For instance:

02/04/2023
12/10/2022
12/11/2022
12/12/2022
12/01/2023


These are inspection dates and they expire in six months. What I need to do is to highlight each cell Red when inspection is due within 30 days and yellow when its due in 60 days and green if it's due in longer than 2 months. How do I go about this please?

Thank you.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You haven't said what you wanted if the date has expired, also none of the dates you list are future dates. However, try this and see if it gives you what you want:

Book1
A
110/05/2023
220/05/2023
330/05/2023
409/06/2023
519/06/2023
629/06/2023
709/07/2023
819/07/2023
929/07/2023
1008/08/2023
1118/08/2023
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A14Expression=AND(A1<>"",(A1-TODAY())<30)textYES
A1:A14Expression=AND(A1<>"",(A1-TODAY())<60)textYES
A1:A14Expression=AND(A1<>"",(A1-TODAY())>=60)textNO
 
Upvote 0
Thank you for you reply. Let me clarify one more time:

I am going to have a column of inspection dates which all took place in the past. I need to conditionally format this column in such manner that any date that is 150 days or more from the cell date will be highlighted red, between 120-150 days to be highlighted yellow and anything up to 120 days from the date in the cell to be highlighted green.
 
Upvote 0
I'm not following you 100%. When you say "any date" versus "cell date" - what are the two dates you're referring to? Could you provide a small sample of your data using the XL2BB add in that clearly indicates what the two dates are?
 
Upvote 0
Inspection dates For ex. this is when the actual inspection took place.
01/01/2023 The inspection is valid for 6 months which is when it needs refreshing. From this cell we can see that next inspection is due 01/01/2023 +180 days. What I want to do is when the this date is approaching inspection to highlight the cell in Red when there is 30 days left before the inspection i.e. 01/01/2023+150 days, yellow when 60 days and green when more than 60 days
12/12/2022
01/12/2022
01/03/2023
07/04/2023
08/04/2023
07/12/2022
08/01/2023
 
Upvote 0
Sorry that didn't copy across well.

List of inspection dates:

01/01/2023
01/12/2022
10/11/2022
07/04/2023

An inspection needs refreshing after 180 days from the inspection date in the column. What I need is that when it's 30 days or less before next inspection must take place, Cell highlights Red, Yellow if it's between 30 and 60 days. Anything that is beyond 60 days- green.

Hope it makes sense.
 
Upvote 0
OK, I think I get what you're after. Try the following:

Book1
A
101/01/2023
201/12/2022
310/11/2022
407/04/2023
512/12/2022
601/03/2023
709/07/2023
8
9
10
11
12
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A12Expression=AND(A1<>"",(A1+180)-TODAY()<=30)textYES
A1:A12Expression=AND(A1<>"",(A1+180)-TODAY()<=60)textYES
A1:A12Expression=AND(A1<>"",(A1+180)-TODAY()>60)textNO
 
Upvote 0
Thank you very much, we are getting somewhere for sure. Only one problem now, it doesn't highlight the cell Red for the first condition. Can you see if I am doing something wrong on my sample here:

1683463579755.png
 
Upvote 0
Actually, I think I had the rules in the wrong order, that has worked now!
 
Upvote 0
Thank you very much, we are getting somewhere for sure. Only one problem now, it doesn't highlight the cell Red for the first condition. Can you see if I am doing something wrong on my sample here:

View attachment 91127
You need to change the order of the conditions. Note how in post #7 I have the <=30 condition in first place, you have it in third place. And as I'm typing this I see you've figured it out already 🙂
 
Upvote 0

Forum statistics

Threads
1,215,767
Messages
6,126,773
Members
449,336
Latest member
p17tootie

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