View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Frank[_25_] Frank[_25_] is offline
external usenet poster
 
Posts: 3
Default How to calculate number of month from 2008 in Excel?

Thank you Soniya.


"Soniya" wrote in message
oups.com...
Just a hint:

if you have =today() in A1 and 31/12/2008 in B1 then

in C1
="=" & (YEAR(B1)-YEAR(A1))*12+MONTH(B1)-MONTH(A1)& " Motnhs, " &
DATEDIF(A1,B1,"md") & " Days"

will give you =34 Months, 24 Days

and
=DATEDIF(A1,B1,"y") & " Year " & DATEDIF(A1,B1,"ym") & " Months " &
DATEDIF(A1,B1,"md") & " Days"

will give you 2 Years 10 Months 24 Days

and

="=" &(YEAR(B1)-YEAR(A1))*12+MONTH(B1)-MONTH(A1)& " and " &
DATEDIF(A1,B1,"md") & "/31"

will give =34 and 24/31

Thanks



Frank wrote:
I need to calculate the number of months from today to 2008 Dec 31, and
put that in an Excel cell with equal sign, and fraction of a month is
divided by 31.

How do I do that?

PS: I am not looking for dedicated VBA script module.

Thank you.