Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
peter.thompson
 
Posts: n/a
Default Leap year date problem


I have a date inserted in cell a1 (28/2/2007). In cell A2 I want the
date at the end of Feb 2008. I am using the following formula:

=DATE(YEAR(A1)+1,MONTH(A1),DAY(A1))

The date returned is 28/2/2008. This should be 29/2/2008

Any ideas how to overcome this??

Cheers

Peter


--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=499584

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Leap year date problem

=date(year(a1)+1,month(a1)+1,0)

The zeroeth day of any month is the last day of the previous month.

(Same with months and years--the zeroeth month of any year is December of the
previous year.)

"peter.thompson" wrote:

I have a date inserted in cell a1 (28/2/2007). In cell A2 I want the
date at the end of Feb 2008. I am using the following formula:

=DATE(YEAR(A1)+1,MONTH(A1),DAY(A1))

The date returned is 28/2/2008. This should be 29/2/2008

Any ideas how to overcome this??

Cheers

Peter

--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=499584


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
peter.thompson
 
Posts: n/a
Default Leap year date problem


Dave

Got it, thanks for your help

Cheers

Peter


--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=499584

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Imported Data Date Format Problem Craig Excel Discussion (Misc queries) 1 December 20th 05 02:23 PM
Date problem using VBA Jean Mark New Users to Excel 3 July 28th 05 07:30 AM
How do I put in the date without the year? Barb Byrd Excel Discussion (Misc queries) 2 March 13th 05 04:46 AM
dHow do I put in the date without the year? Barb L Excel Discussion (Misc queries) 2 March 5th 05 10:45 PM
Date Math Problem Dkline Excel Worksheet Functions 4 March 4th 05 04:11 PM


All times are GMT +1. The time now is 07:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"