hello. what's my formula if I want to get the number of months from let's
say 4/15/2005 to 4/30/2006? I know I can simply do a (4/30/06 less 4/15/05)
divided by 30. But that comes out as 12.66666. What's the best formula?
Thank you very much!
Claudine
What do *you* mean by "best".
Since months (and years) do not all have the same number of days, you need to
decide how you want to handle all sorts of irregularities.
In your example above, the result is fairly simple at 12 months (and 15 days).
But take, for example, 1/29/2005 2/28/2005
de Bruins formula will give a result of "0" months, because of assumptions
within the DATEDIF formula.
I would think a result of 1 month 2 days would be appropriate. But you might
want 1 2/28 or 1 1/14 months.
One convention would be to count full calendar months, and then either
fractional months or the actual days for the first and last months. This might
lead to a result of 11 months 45 days, though.
Another way could be to do full calendar months, but then compute the
fractional months taking into account the numbers of days in the beginning and
ending months.
It's up to you to define how you want to handle these instances.
--ron