Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have a "from" date in col A and a "to" date in Col B In Col C, I'm using the following formula to find the days between the two dates in A and B. =B8-A8 Is there something I can add to this formula to add one day to the answer in col C ....if it's a leap year. For example, if I have 1/1/05 in A8 and 12/31/05 in B8, the answer is 364...and I need it to be the full year of 365 days. Not sure how to adjust the formula for leap year or if that is possible.. Thanks in advance for you help.. Kimberly |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kimberly,
Excel automatically adjusts date values for leap years based on a built-in algorithm. Excel by default interprets values as dates if they are in any of several recognized formats. The years 2000, 2004, 2008 etc. are leap years while 2005 is not (in case you were thinking it was). Change the values in A8 and B8 to 1/1/2000 and 12/31/2000 or to 1/1/2004 and 12/31/2004 and the result should be 365 instead of 364. If you just want the formula to return the number of days between the two dates inclusive of the two dates then just add one to the formula: "=B8-A8+1". Regards, Greg "KimberlyC" wrote: Hi I have a "from" date in col A and a "to" date in Col B In Col C, I'm using the following formula to find the days between the two dates in A and B. =B8-A8 Is there something I can add to this formula to add one day to the answer in col C ....if it's a leap year. For example, if I have 1/1/05 in A8 and 12/31/05 in B8, the answer is 364...and I need it to be the full year of 365 days. Not sure how to adjust the formula for leap year or if that is possible.. Thanks in advance for you help.. Kimberly |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Average between dates considering leap years. | Excel Discussion (Misc queries) | |||
Calc days between two dates and exclude leap year days | Excel Worksheet Functions | |||
Calculating to add years - including leap year | Excel Worksheet Functions | |||
problem of calculating years months and days | Excel Discussion (Misc queries) | |||
FORMULA FOR CALCULATING YEARS, DAYS, & MONTHS BETWEEN SEVERAL DATE | Excel Discussion (Misc queries) |