If date greater than 5 years, fill cell with Yes otherwise with No

The CMF

New Member
Joined
Oct 11, 2018
Messages
4
Hi,
I managed to get conditional formatting on colomn B which works great.
=B1<=DATE(YEAR(TODAY())-5;MONTH(TODAY());DAY(TODAY()))

However I need a formula that will fill the column A: If date is greater than 5 years, then results should be Yes otherwise No.
1616514418961.png

Can someone help me out with that?
Thanks
Raoul
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi TheCMF

This should work.

Book1
AB
1Yes5/21/2012
2Yes3/8/2016
3Yes11/5/2013
4No6/7/2016
5No4/1/2019
Sheet1
Cell Formulas
RangeFormula
A1:A5A1=IF(EDATE(B1,60)>TODAY(),"No","Yes")
 
Upvote 0
Solution
Essentially the same
Excel Formula:
=IF(B1<=DATE(YEAR(TODAY())-5;MONTH(TODAY());DAY(TODAY()));"yes";"No")

Example with semi colons as per yours
 
Upvote 0
Hi Toadstool

Thanks for your reply, I forgot to mention that sometimes there is no date, just a blank cell. Using the formula it shows "Yes" when the date cell is blank.
How can avoid this?
Thanks!
Hi TheCMF
Hi TheCMF

This should work.

Book1
AB
1Yes5/21/2012
2Yes3/8/2016
3Yes11/5/2013
4No6/7/2016
5No4/1/2019
Sheet1
Cell Formulas
RangeFormula
A1:A5A1=IF(EDATE(B1,60)>TODAY(),"No","Yes")


This should work.

Book1
AB
1Yes5/21/2012
2Yes3/8/2016
3Yes11/5/2013
4No6/7/2016
5No4/1/2019
Sheet1
Cell Formulas
RangeFormula
A1:A5A1=IF(EDATE(B1,60)>TODAY(),"No","Yes")
 
Upvote 0
You could just add another IF

TheCMF.xlsx
AB
1Yes5/21/2012
2 
3 
4Yes3/8/2016
5 
6 
7Yes11/5/2013
8No6/7/2016
9No4/1/2019
10 
Sheet1 (2)
Cell Formulas
RangeFormula
A1:A10A1=IF(ISNUMBER(B1),IF(EDATE(B1,60)>TODAY(),"No","Yes"),"")
 
Upvote 0
Hi TheCMF

This should work.

Book1
AB
1Yes5/21/2012
2Yes3/8/2016
3Yes11/5/2013
4No6/7/2016
5No4/1/2019
Sheet1
Cell Formulas
RangeFormula
A1:A5A1=IF(EDATE(B1,60)>TODAY(),"No","Yes")
Hi, first of all, thanks for the formula! It works! But how can i replace the 60 with a column of months data that i have.

Instead of 5 years, i have a column of different year values.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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