View Single Post
 
Old 01-25-2011, 11:13 AM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline Windows XP Office 2003
Simulacrum
 
Join Date: Jan 2010
Location: Victoria, Canada
Posts: 86
ConneXionLost is on a distinguished road
Default

In your formula, you appear to be trying to subtract one date from another to get the number of days difference, then asking for the number of months those days would total.

The first part is okay, since your result of B2-A2 comes to 729 days. The problem is with your use of the MONTH function. The MONTH function will give you a month (as a number 1-12) if you give it a date. However, you are asking Excel to tell you what month is "729". Excel is converting the number 729 to a date, in this case it is 29 Dec 1901. The MONTH function then correctly provides you with the number 12 to represent December.

It might be better for you to use the DATEDIF function instead.

For your example, you might try this:

Code:
=DATEDIF(A2,B2,"m")&" months "&DATEDIF(A2,B2,"md")&" days"
Cheers,
Reply With Quote