ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date manipulation question (https://www.excelbanter.com/excel-programming/298316-date-manipulation-question.html)

NikkoW

Date manipulation question
 
Hi, everyone.

I am trying to add several months to a date in a field.

Let's say that cell C3 contains the date Aug 1, 2003.

In cell D3 I want to add 18 months to that.

I can seem to add days but not months. The online help (if you can call it
that) isn't much help beyond saying "you can manipulate dates."

Thanks in advance for the help.

Nikko



Bob Phillips[_6_]

Date manipulation question
 
=DATE(YEAR(C3),MONTH(C3)+18,DAY(C3))

You need to be careful though as adding 18 might end up at the start of a
month after, for instance 31 May gives 1st Dec 2005.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"NikkoW" wrote in message
e.rogers.com...
Hi, everyone.

I am trying to add several months to a date in a field.

Let's say that cell C3 contains the date Aug 1, 2003.

In cell D3 I want to add 18 months to that.

I can seem to add days but not months. The online help (if you can call it
that) isn't much help beyond saying "you can manipulate dates."

Thanks in advance for the help.

Nikko





Frank Kabel

Date manipulation question
 
Hi
as addition to Bob to prevent this problem you may use:
=DATE(YEAR(C3),MONTH(C3)+18,MIN(DAY(C3),DAY(DATE(Y EAR(C3),MONTH(C3)+18+
1,0))))

--
Regards
Frank Kabel
Frankfurt, Germany

"Bob Phillips" schrieb im
Newsbeitrag ...
=DATE(YEAR(C3),MONTH(C3)+18,DAY(C3))

You need to be careful though as adding 18 might end up at the start

of a
month after, for instance 31 May gives 1st Dec 2005.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"NikkoW" wrote in message
e.rogers.com...
Hi, everyone.

I am trying to add several months to a date in a field.

Let's say that cell C3 contains the date Aug 1, 2003.

In cell D3 I want to add 18 months to that.

I can seem to add days but not months. The online help (if you can

call it
that) isn't much help beyond saying "you can manipulate dates."

Thanks in advance for the help.

Nikko







All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com