DATEDIF is a worksheet function that will return the difference between two dates in a variety of intervals. As far as I can tell, DATEDIF truncates any partial intervals. If the difference was two months and one day, it would return two months. I had a situation where I needed to count partial months as whole months. I didn’t see any options for that using DATEDIF, so I came up with this formula:
The idea is that it will always add one unless the start date and end date are the same day, and thus there is no fraction of a month. This formula happened to work for my data, but there’s an error. If the start date is 28 Feb 2005 and the end date is 31 Mar 2005, it returns 2, which is obviously wrong. Then I came up with this:
That takes care of two month end dates that aren’t the same number, but still gives wrong results for, say, 28 Feb v. 30 Mar. This should not be that hard, I think I just killed too many brain cells over the holiday weekend. Suggestions?