# Solved Need help in the function to compare dates

November 20, 2014 at 02:53:06
Specs: Windows 7
 In Cell A I have a date from 2013, In Cell B I need to write a formula that returns the End date of 2013 if A1+14 days fall into 2014. A1: 30-Dec-2014As A1+14 days = 13-Jan-2014In B1 I need to see 31-Dec-2014Could somebody help me with this function in Excel 2007?

See More: Need help in the function to compare dates

#1
November 20, 2014 at 04:30:05
✔ Best Answer
 You appear to have mixed up the "years" in your question. You asked about 2013 but the dates you use are all 2014. In addition, your math is wrong.If A1 contains 30-Dec-2014, then A1+14 days = 13-Jan-2015, not 2014.In any case, I believe this formula will work for any date, in any year, where A1+14 pushes the resulting date into the following year.=IF(YEAR(A1+14)>YEAR(A1), EOMONTH(A1,0),A1+14)message edited by DerbyDad03

Report •

#2
November 20, 2014 at 20:12:07
 Hi Derby, Thank you so much :-) .. Yes I made a mistake on dates.. it was 2013 actuallty.. I will try this. Thanks!

Report •

Related Solutions