View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Thomas Dave Thomas is offline
external usenet poster
 
Posts: 146
Default Month Calculation

There is an undocumented function in Excel called DATEDIF. Microsoft has
never documented it. It comes from Lotus 1-2-3.
It does not appear in the list of functions. You must manually type it in.
Its format is =DATEDIF(start_date,end_date,"F"). Note that start_date must
be less or equal to end_date or you will get a #NUM error.
F must be in quotes and may be the following:

"y" The number of complete years in the period
"m" The number of complete months in the period
"d" The number of days in the period.
"md" The difference between the days in start_date and
end_date. The months and years of the dates are ignored.
"ym" The difference between the months in start_date and
end_date. The days and years of the dates are ignored.
"yd" The difference between the days in start_date and
end_date. The years of the dates are ignored.

So if cell A1 has 30.06.05 and cell A2 has 19.11.04 then
=DATEDIF(A2,A1,"m") would return 7, the number of whole months difference
between those dates.


"Tony" wrote in message
...
I would like to calcuate the diff in the dates by in term of months e.g.
30.06.05 less 19.11.04 = 8 months. What function should I use, could any
one
help please. Thanks