ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Number of Completed Months (https://www.excelbanter.com/excel-discussion-misc-queries/170825-number-completed-months.html)

Rick[_3_]

Number of Completed Months
 
Hi,

How can I get the number of COMPLETED months returned between 2 dates?

At times it may be grater than 12 months - but never greater than 24
months.

I've been fiddling with =Floor and =Ceiling but when the dates are in
a different year it has me stumped. For example ...

A1 = 15-Jun-07
A2 = 23-Oct-08

Need a formula to return "15" months

Tks, Kaye

Bob Phillips

Number of Completed Months
 
=DATEDIF(A1,A2,"M")

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Rick" wrote in message
...
Hi,

How can I get the number of COMPLETED months returned between 2 dates?

At times it may be grater than 12 months - but never greater than 24
months.

I've been fiddling with =Floor and =Ceiling but when the dates are in
a different year it has me stumped. For example ...

A1 = 15-Jun-07
A2 = 23-Oct-08

Need a formula to return "15" months

Tks, Kaye




RichardSchollar[_2_]

Number of Completed Months
 
Hi

Try this - it can probably be simplified further:

=DATEDIF(A1,A2,"m")-(DAY(A1)<DAY(A2))+(DAY(A1)=1)+
(DATE(YEAR(A2),MONTH(A2)+1,0)=A2)

Richard


On Dec 27, 11:51 am, Rick wrote:
Hi,

How can I get the number of COMPLETED months returned between 2 dates?

At times it may be grater than 12 months - but never greater than 24
months.

I've been fiddling with =Floor and =Ceiling but when the dates are in
a different year it has me stumped. For example ...

A1 = 15-Jun-07
A2 = 23-Oct-08

Need a formula to return "15" months

Tks, Kaye



Rick[_3_]

Number of Completed Months
 
Thanks Bob and Richard for the rapid reply!

Cheers,
Kaye (via Rick's account)



All times are GMT +1. The time now is 05:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com