ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   months between 2 dates!!! (https://www.excelbanter.com/excel-discussion-misc-queries/41268-months-between-2-dates.html)

speary

months between 2 dates!!!
 

A few weeks ago I posted a thread asking for a formula to count number
of months between 2 dates with partial months counted as whole months.

Here is what my spreadsheet looked like:

START END TOTAL
DATE DATE MONTHS
1/1/2005 4/29/2005 4

The formula I used is as follows:

=IF(I51="","",MONTH(I51)-MONTH(H51)+1)

Now in actually using the sheet I found that this formula is basically
useless when the difference between the 2 dates exceeds a year for
example:

START END TOTAL
DATE DATE MONTHS
1/1/2005 4/29/2006 4

Does anyone know what formula I can enter so that the fact that the
total months exceeds a year will be counted as such? In the second
example I provided I want it to say 16 months, not 4.

Any help will be greatly appreciated!


--
speary
------------------------------------------------------------------------
speary's Profile: http://www.excelforum.com/member.php...o&userid=24959
View this thread: http://www.excelforum.com/showthread...hreadid=397218


speary


I seemed to have figured it out...

=IF(I51="","",(YEAR(I51)-YEAR(H51))*12+MONTH(I51)-MONTH(H51)+1)

but if anyone sees why this may not work please let me know...thank you


--
speary
------------------------------------------------------------------------
speary's Profile: http://www.excelforum.com/member.php...o&userid=24959
View this thread: http://www.excelforum.com/showthread...hreadid=397218



All times are GMT +1. The time now is 11:29 AM.

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