View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
nginhong
 
Posts: n/a
Default How to calculate "number of months" between two given date?

Hello John,

I managed to find out the error of the formula because the regional setting
in my PC is using semicolon for delimiters.

I would say you formula is very close to what I am looking forward but the
set back a-
=(YEAR(A3)-YEAR(A2))*12+MONTH(A3)-MONTH(A2)+ROUNDUP((DAY(A3)-DAY(A2))/31;0)

1. Unable to show result as 1 month if start date is 28/02/2006 and end date
is 02/03/2006.
2. Unable to show result as 13 months if start date is 28/02/2006 and end
date is 02/03/2007.

However I really appreciate your help.

Thanks & Regards,
Ngin Hong

"John James" wrote:


How about:
=(YEAR(A3)-YEAR(A2))*12+MONTH(A3)-MONTH(A2)
+ROUNDUP((DAY(A3)-DAY(A2))/31,0)

Closer?


--
John James
------------------------------------------------------------------------
John James's Profile: http://www.excelforum.com/member.php...o&userid=32690
View this thread: http://www.excelforum.com/showthread...hreadid=532164