View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John C[_2_] John C[_2_] is offline
external usenet poster
 
Posts: 1,358
Default Date Calculations

Since you are rounding up, the only time you would not add 1 is if the day of
the month is the same, so this formula should work for you:

=DATEDIF(startdate,enddate,"m")+IF(DAY(startdate)= DAY(enddate),0,1)

--
John C


"Tommy" wrote:

I have a worksheet with a beginning and ending date range. I need the number
of months for the range but also need them rounded up to the next month.

For example:

13-Jul-11 to 31-Jul-12 should calculate as 13 months and not the 12 provided
by the DATEDIF function.

In short, I need to round up to the next month for my calculations.

05-Mar-11 to 31-Dec-11 should return 10 full months and not 9.

Is there an easy way to do this?