ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Number of Months Counts (https://www.excelbanter.com/excel-worksheet-functions/177674-number-months-counts.html)

Jalal

Number of Months Counts
 
Would like to know the function that returns the number of months, for
example to return 20 for the months from Feb-2008 to Sep-2009.

Bernard Liengme

Number of Months Counts
 
Have a look at DATEDIF. This is undocumented but Chip tells all at
www.cpearson.com
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Jalal" wrote in message
...
Would like to know the function that returns the number of months, for
example to return 20 for the months from Feb-2008 to Sep-2009.




Rick Rothstein \(MVP - VB\)[_78_]

Number of Months Counts
 
And if you weren't aware of the DATEDIF function that Bernard referred you
to, you could always do it the long way...

=12*(YEAR(B10)-YEAR(A10))+MONTH(B10)-MONTH(A10)+1

where it is assumed your begin date is in A1 and your end date is in B1.

Rick


"Jalal" wrote in message
...
Would like to know the function that returns the number of months, for
example to return 20 for the months from Feb-2008 to Sep-2009.



Jalal

Number of Months Counts
 
Thanks guys.

"Rick Rothstein (MVP - VB)" wrote:

And if you weren't aware of the DATEDIF function that Bernard referred you
to, you could always do it the long way...

=12*(YEAR(B10)-YEAR(A10))+MONTH(B10)-MONTH(A10)+1

where it is assumed your begin date is in A1 and your end date is in B1.

Rick


"Jalal" wrote in message
...
Would like to know the function that returns the number of months, for
example to return 20 for the months from Feb-2008 to Sep-2009.





All times are GMT +1. The time now is 02:33 AM.

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