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.
It depends how you define the difference between months, A simple answer
which is close to what you want is
=(DATE(2008,12,31)-TODAY())/365.25*12
How bothered are you about the 31 and this will give a different
reading as all months are not the same length than the literal number
of months, but it is very close
Dav--
Dav
------------------------------------------------------------------------
Dav's Profile: www.excelforum.com/member.php...oamp;userid=27107
View this thread: www.excelforum.com/showthread...hreadid=509270You can use DATEDIF() for this: with today's date in A1 and 31/12/08 in
A2 the formula is
=DATEDIF(A1,A2,quot;Mquot;)
DATEDIF(DATE(YEAR(A1),MONTH(A1) DATEDIF(A1,A2,quot;Mquot;) ,DAY(A1)),A2,quot;Dquot;)/31
Frank wrote:
gt; I need to calculate the number of months from today to 2008 Dec 31, and
gt; put that in an Excel cell with equal sign, and fraction of a month is
gt; divided by 31.
gt;
gt; How do I do that?
gt;
gt; PS: I am not looking for dedicated VBA script module.
gt;
gt; Thank you.I guess Excel takes care of the fact that months have a different nmber
of days.
So when you you subtract date1 from date2 and the receiving cell is
formatted as e.g. dd.mm.yy then the result would read something like
11.23.02 which means the difference is 11 days, 23 months and 2 years.
HansNo, this is not correct. Try a few examples.flummi wrote:
gt; I guess Excel takes care of the fact that months have a different nmber
gt; of days.
gt;
gt; So when you you subtract date1 from date2 and the receiving cell is
gt; formatted as e.g. dd.mm.yy then the result would read something like
gt; 11.23.02 which means the difference is 11 days, 23 months and 2 years.
gt;
gt; HansNo, this is not correct. Try a few examples.flummi wrote:
gt; I guess Excel takes care of the fact that months have a different nmber
gt; of days.
gt;
gt; So when you you subtract date1 from date2 and the receiving cell is
gt; formatted as e.g. dd.mm.yy then the result would read something like
gt; 11.23.02 which means the difference is 11 days, 23 months and 2 years.
gt;
gt; HansYou are right, I should have tried it. :-(How about this:
=quot;=quot;amp;DATEDIF(TODAY(),DATE(2008,12,31),quot;mquot;) ROUND(( DATEDIF(TODAY(),DATE(2008,12,31),quot;mdquot;)/31),2)
should give you something like =34.77 with the equal sign
HTH
JG
quot;Frankquot; wrote:
gt; I need to calculate the number of months from today to 2008 Dec 31, and
gt; put that in an Excel cell with equal sign, and fraction of a month is
gt; divided by 31.
gt;
gt; How do I do that?
gt;
gt; PS: I am not looking for dedicated VBA script module.
gt;
gt; Thank you.
gt;
gt;
gt;
gt;
gt;
- Jul 16 Mon 2007 20:38
How to calculate number of month from 2008 in Excel?
close
全站熱搜
留言列表
發表留言
留言列表

