Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I Add or subtract months or years from a date in Excel
Trying to add and subtract years and ormonths to dates and concidering leap
years. =IF(IF(D25,B2-365,IF(D2<3,B2-365,IF(C2/4=INT(C2/4),B2-363,B2-364)))<NOW(),NOW(),IF(C25,B2-365,IF(C2<3,B2-365,IF(C2/4=INT(C2/4),B2-363,B2-364)))) is too cryptic! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I Add or subtract months or years from a date in Excel
Hi Dug,
Seems you're not using real Excel dates. You should, absolutely! It looks like D2 is your month, C2 is the year and B2 is the day. Adjust if I'm wrong. In E2, put: =date(C2,D2,B2) To add a year: =Date(year(E2)+1,month(E2),day(E2)) etc -- Kind Regards, Niek Otten Microsoft MVP - Excel "Dug Rowland" <Dug wrote in message ... Trying to add and subtract years and ormonths to dates and concidering leap years. =IF(IF(D25,B2-365,IF(D2<3,B2-365,IF(C2/4=INT(C2/4),B2-363,B2-364)))<NOW(),NOW(),IF(C25,B2-365,IF(C2<3,B2-365,IF(C2/4=INT(C2/4),B2-363,B2-364)))) is too cryptic! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I Add or subtract months or years from a date in Excel
But of course some issues remain; what do you expect the date plus one year
to be if the original date in a leap year is Feb 29? A resume about dates (and times) in Excel can be found at http://www.cpearson.com/excel/datetime.htm#SerialDates -- Kind Regards, Niek Otten Microsoft MVP - Excel "Niek Otten" wrote in message ... Hi Dug, Seems you're not using real Excel dates. You should, absolutely! It looks like D2 is your month, C2 is the year and B2 is the day. Adjust if I'm wrong. In E2, put: =date(C2,D2,B2) To add a year: =Date(year(E2)+1,month(E2),day(E2)) etc -- Kind Regards, Niek Otten Microsoft MVP - Excel "Dug Rowland" <Dug wrote in message ... Trying to add and subtract years and ormonths to dates and concidering leap years. =IF(IF(D25,B2-365,IF(D2<3,B2-365,IF(C2/4=INT(C2/4),B2-363,B2-364)))<NOW(),NOW(),IF(C25,B2-365,IF(C2<3,B2-365,IF(C2/4=INT(C2/4),B2-363,B2-364)))) is too cryptic! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I Subtract 6 months off a date in excel | Excel Discussion (Misc queries) | |||
subtract years and months (as in ages) from another age | Excel Discussion (Misc queries) | |||
To create formula to add 3 years and subtract 1 day from a date? | Excel Worksheet Functions | |||
How do I subtract a date from a date for a sum of total years? | Excel Discussion (Misc queries) | |||
Excel Adding years or months to a date | Excel Discussion (Misc queries) |