ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date calculation problem (https://www.excelbanter.com/excel-programming/382806-date-calculation-problem.html)

TonyL

Date calculation problem
 
Cell A1 contains a date & I want to calculate to the end of that of that year
period i.e. cell A1 contains 01/04/2007 & I want cell A2 to be 31/03/2008
(ddmmyyyy format). =A1+364 won't do as this does not take into account leap
years. TIA
--
Tony

NickHK

Date calculation problem
 
Tony,
Basically, +1 year and -1 day from the start:

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

NickHK

"TonyL" wrote in message
...
Cell A1 contains a date & I want to calculate to the end of that of that

year
period i.e. cell A1 contains 01/04/2007 & I want cell A2 to be 31/03/2008
(ddmmyyyy format). =A1+364 won't do as this does not take into account

leap
years. TIA
--
Tony




TonyL

Date calculation problem
 
Thanks Nick. That did the trick
--
Tony


"NickHK" wrote:

Tony,
Basically, +1 year and -1 day from the start:

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

NickHK

"TonyL" wrote in message
...
Cell A1 contains a date & I want to calculate to the end of that of that

year
period i.e. cell A1 contains 01/04/2007 & I want cell A2 to be 31/03/2008
(ddmmyyyy format). =A1+364 won't do as this does not take into account

leap
years. TIA
--
Tony






All times are GMT +1. The time now is 01:18 PM.

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