ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Need help calculating months (https://www.excelbanter.com/excel-discussion-misc-queries/98450-need-help-calculating-months.html)

Baldrick

Need help calculating months
 
I have 1 colum of dates, in another i would like the number of months between
today and that date, either positve or negitive. However "=month(x)-month(y)"
doesnt recongnize a difference in years. For example 4/17/07 - 7/10/06
returns -3 instead of +9. My dates vary from over a year ago to over a year
from now. Does anyone know of a possible solution?

excelent

Need help calculating months
 
=(YEAR(NOW())-YEAR(A2))*12+(MONTH(NOW())-MONTH(A2))



"Baldrick" skrev:

I have 1 colum of dates, in another i would like the number of months between
today and that date, either positve or negitive. However "=month(x)-month(y)"
doesnt recongnize a difference in years. For example 4/17/07 - 7/10/06
returns -3 instead of +9. My dates vary from over a year ago to over a year
from now. Does anyone know of a possible solution?


Bob Phillips

Need help calculating months
 
=datedif(start_date,end_date,"m")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Baldrick" wrote in message
...
I have 1 colum of dates, in another i would like the number of months

between
today and that date, either positve or negitive. However

"=month(x)-month(y)"
doesnt recongnize a difference in years. For example 4/17/07 - 7/10/06
returns -3 instead of +9. My dates vary from over a year ago to over a

year
from now. Does anyone know of a possible solution?




Baldrick

Need help calculating months
 
Thanks, it working like a champ.

"excelent" wrote:

=(YEAR(NOW())-YEAR(A2))*12+(MONTH(NOW())-MONTH(A2))



"Baldrick" skrev:

I have 1 colum of dates, in another i would like the number of months between
today and that date, either positve or negitive. However "=month(x)-month(y)"
doesnt recongnize a difference in years. For example 4/17/07 - 7/10/06
returns -3 instead of +9. My dates vary from over a year ago to over a year
from now. Does anyone know of a possible solution?



All times are GMT +1. The time now is 12:35 AM.

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