ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Calculate number of months between 2 dates (https://www.excelbanter.com/new-users-excel/28721-calculate-number-months-between-2-dates.html)

john liem

Calculate number of months between 2 dates
 

Hi Daniel, thanks and works fine, though I added a condition "if(ending
date - starting date =20,0)". .... (smaller or equal to 20)
John.

Daniel CHEN Wrote:
Use the following formula:

=(YEAR(A2)-YEAR(A1))*12+MONTH(A2)-MONTH(A1)-1+IF(DAY(A1)=15,1,0)+IF(DAY(A2)=15,1,0)

assume A1 is starting date and A2 is ending date.

===== * ===== * ===== * =====
Daniel CHEN

Spreadsheet/VBA Specialist

www.Geocities.com/UDQServices
Try UDQ Consulting Services - Your "Impossible" Task Could Be Someone
Else's
"Piece of Cake"
===== * ===== * ===== * =====




"john liem" wrote in
message
.. .-

I have a Start Date and an End Date, need to calculate the number of
months in between. Conditions: Start date =15th includes the month,
End date = 15th includes the month.
Examples: between 14-04-05 and 15-06-05: 3 months, between 16-04-05
and
13-06-05: 1 month, between 16-02-04 and 03-05-05: 14 months. Thank
you.
John


--
john liem-



--
john liem


All times are GMT +1. The time now is 10:50 AM.

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