# Thread: Calculate months between dates (98/2000)

1. ## Calculate months between dates (98/2000)

I can't work out an elegant way of accurately calculating the number of months between two date, (I can do it the long way with many columns) any ideas?

2. ## Re: Calculate months between dates (98/2000)

There is an undocumented function to help, called DATEDIF

If your dates are in A1 and B1 (earliest in A1) then the following returns the number of whole months between the 2 :

=DATEDIF(A1,B1,"m")

Changinh "m" to "d" gives the nummber of days, and "y" the number of years etc.

Andrew C

3. ## Re: Calculate months between dates (98/2000)

Here's Chip Pearson's humorous documentation of DATEDIF. If you have XL2K or later, there is documentation in the help files, but it is not listed in the paste function dialog box. --Sam

4. ## Re: Calculate months between dates (98/2000)

Wow!

The hours, nay, days I have lost trying to do this simple task, AND IT WAS THERE ALL ALONG!

To paraphrase W.C. Fields: "Microsoft drove me to drink, and I didn't even have the courtesy to thank them!"

Thanks for the tip.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•