Conditional formatting expiration date

David77

Board Regular
Joined
Jun 24, 2020
Messages
109
Office Version
  1. 365
Platform
  1. Windows
Hello everybody,

I want to create a conditional formatting for the following column in my stock portfolio:
1604667963908.png



I would like 2 conditional formatting (i have two of these sheets, which are identical, so one for each):

1) I would like the first formula to highlight the cells if the date entered is 1 month ago or more from the current date. I imagine some sort of =today()-30, but I tried this and it did not work :( Would appreciate any help!
2) Same as 1) but when the data in the cell is = to the current data. Also highlighted with red.


Thank you everybody! :)
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hello,

Well. You need to create two rules. One rule for each of your points.

As for conditions:

AD1. I used this: =IF($E1="";0;Today()-$E1)>=30
This $E1 will tell Excel to check proper cell of a row.
Formula says: If E1 is empty put 0, otherwise subtract today's E1 from todays date. If result is 30 or above fire formatting. Otherwise skip it.

AD2. =$E1=Today()
 
Upvote 0
Another option
Excel Formula:
=AND(E2<>"",E2<=EDATE(TODAY(),-1)
=E2=TODAY()
 
Upvote 0
Another option
Excel Formula:
=AND(E2<>"",E2<=EDATE(TODAY(),-1)
=E2=TODAY()
Thank you so much Fluff!!

May I ask, if I wanted to do this formula:

=AND(E2<>"""";E2<=EDATE(TODAY();-1)) (the first one you made).

But with +6 months.

How would I do that? I tried doing it by just replacing -1 with +6, but it doesn't accep that.

Can you help me out?

Thank you!!! :)
 
Upvote 0
You have too many "" in the first part of the formula, otherwise it should work.
 
Upvote 0
Fina
Another option
Excel Formula:
=AND(E2<>"",E2<=EDATE(TODAY(),-1)
=E2=TODAY()

Final note!

Is it possible to update the formatting, so if the cell is blank, it won't be highlighted either? Otherwise it looks like this:

1605098764728.png
 
Upvote 0
It should be Edate not Kdate
 
Upvote 0
He
It should be Edate not Kdate
Hello Fluff,

I wrote Edate now:

1605683916136.png


But it still doesnt work, I tried entering an old date (15-10-2015) and it does not get highlighted :(

Any tips?
 
Upvote 0
It should be Edate not Kdate
Nevermind! I should have entered 2025.

It works now - thank you so much Fluff!!! You're amazing :D :D

Have a great day! Marked your response as the correct answer :)
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,453
Members
448,898
Latest member
drewmorgan128

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