# Dates in Excel

Closed
Artemis33 - Sep 29, 2009 at 08:23 PM
venkat1926 Posts 1864 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Sep 30, 2009 at 08:23 PM
Hello,

I am having the hardest time with what seems to be a simple problem in Excel 2003...

I have this formula:
IF(C4<(\$C\$1-90),\$D\$1-\$C\$1,\$D\$1-(C4+90))

Where C4 = March 8, 2004
C1 = September 1, 2008
D1 = August 31, 2009

The result cells are formatted as: m "months", d "days";@

The problems is that the result is shown as "12 months, 29 days"... It should show 12 months.

Am I missing a step or doing something wrong?

Thanks a bunch for any help you can provide!

## 2 replies

venkat1926 Posts 1864 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 810
Sep 29, 2009 at 10:14 PM
I am not sure
perhaps the mistakes comes in formatting as months and daysl

the dates in excel are actually number (days from 1 jan 1900 or something like that )
if you format it as days it will be 364 days.
if you convert this into months and days there will be problem.are you going to divide by 30 or 31 or 29 or 28.

try this formula
=datedif(c1,d1,"d")

Thank you for your response.

Even though I need the result to show in months and days, I had tried =datedif(c1,d1,"d"), but that comes out as 364 days... However, it should show 365 days (and 366 days if February 2008 were included in the time frame).

Is there any way for Excel to accurately count the number of months and days between two dates? If so, how.

Thank you!
venkat1926 Posts 1864 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 810
Sep 30, 2009 at 08:23 PM
Is this not semantic problem? 5 minus 1 is 4. the difference means incremental. sep 1 to sep 5 th is only 4 days. think about it closely.