close

I want to calculate calendarmonths between two dates eg finish date (A2)31
Mar 2006, start date (A1)1 Oct 2005. The answer wanted is 6 months. I am
currently using =ROUNDUP((A2-A1)/30,0). However not every month is 30 days,
and in this example the formula answer is 7. 2 Oct 2005 would give the right
answer. Similarly, 31 Jan 2006 would return 2, whereas I want it to return 3
(ie three calendar months within the date period). How can I enter the
formula which will recognise what I am trying to do.

Regards


try the datedif function

=DATEDIF(A1,B1,quot;mquot;)--
davesexcel------------------------------------------------------------------------
davesexcel's Profile: www.excelforum.com/member.php...oamp;userid=31708
View this thread: www.excelforum.com/showthread...hreadid=541356Thanks Dave,
DATEDIF gives the months difference, I want the months inclusive. I think I
will be able to use this function though with a bit of manipulation unless
you have another answer.
Incidentally, as a function I cannot bring up quot;DATEDIFquot; on my help screens.

quot;davesexcelquot; wrote:

gt;
gt; try the datedif function
gt;
gt; =DATEDIF(A1,B1,quot;mquot;)
gt;
gt;
gt; --
gt; davesexcel
gt;
gt;
gt; ------------------------------------------------------------------------
gt; davesexcel's Profile: www.excelforum.com/member.php...oamp;userid=31708
gt; View this thread: www.excelforum.com/showthread...hreadid=541356
gt;
gt;


pkeegs Wrote:
gt; Thanks Dave,
gt; DATEDIF gives the months difference, I want the months inclusive. I
gt; think I
gt; will be able to use this function though with a bit of manipulation
gt; unless
gt; you have another answer.
gt; Incidentally, as a function I cannot bring up quot;DATEDIFquot; on my help
gt; screens.
gt;
gt;
gt; gt;[/color]
Either can I,
it seems to be one of those secret functions--
davesexcel------------------------------------------------------------------------
davesexcel's Profile: www.excelforum.com/member.php...oamp;userid=31708
View this thread: www.excelforum.com/showthread...hreadid=541356I have Walkenbach's Excel 2003 Bible right in front of me. He mentions
the lack of references to it in the last few versions of the Excel.
Apparently the function has its origins in Lotus123 and is still there
for compatability reasons. No idea why they still don't want to
mention it in the online help.My simple answer to have the inclusive number of months is to add 1 at the
end of the formula and it is working well, hence =DATEDIF(A1,B1,quot;mquot;) 1

Thanks amp; regards (Interesting about the lack of help on the function)

quot;davesexcelquot; wrote:

gt;
gt; try the datedif function
gt;
gt; =DATEDIF(A1,B1,quot;mquot;)
gt;
gt;
gt; --
gt; davesexcel
gt;
gt;
gt; ------------------------------------------------------------------------
gt; davesexcel's Profile: www.excelforum.com/member.php...oamp;userid=31708
gt; View this thread: www.excelforum.com/showthread...hreadid=541356
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()