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-2014

As A1+14 days = 13-Jan-2014

In B1 I need to see 31-Dec-2014Could somebody help me with this function in Excel 2007?

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)

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

message edited by DerbyDad03

Hi Derby,

Thank you so much :-) .. Yes I made a mistake on dates.. it was 2013 actuallty.. I will try this.Thanks!

Ask Your Question

Weekly Poll

Do you think Salesforce should have bought Slack?

Discuss in The Lounge

Poll History