Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Formula to figure out months between two dates

I have an excel spreadsheet that I download from a vendor that has the dates
listed as MAY/17/2010 - JUL/31/2011 and I am not able to use my existing
formula to figure out the number of months between two dates.

I was using =(YEAR(cell for end date)-YEAR(cell for start
date))*12+MONTH(cell for end date)-MONTH(cell for start date) which was
working great but now since the vendor changed their date format it won't
work. I have even tried to format those cells to yyyy-mm-dd but they stay as
they are above.

Any help would be greatly appreciated because I don't want to have to retype
all the dates each time to get the month formula to work.

Thank you in advance.

Kim
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Formula to figure out months between two dates

Hi,

Try this

=datedif(A2,B2,"m")

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Kimbe" wrote in message
...
I have an excel spreadsheet that I download from a vendor that has the
dates
listed as MAY/17/2010 - JUL/31/2011 and I am not able to use my existing
formula to figure out the number of months between two dates.

I was using =(YEAR(cell for end date)-YEAR(cell for start
date))*12+MONTH(cell for end date)-MONTH(cell for start date) which was
working great but now since the vendor changed their date format it won't
work. I have even tried to format those cells to yyyy-mm-dd but they stay
as
they are above.

Any help would be greatly appreciated because I don't want to have to
retype
all the dates each time to get the month formula to work.

Thank you in advance.

Kim


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Formula to figure out months between two dates

On May 17, 1:36*pm, Kimbe wrote:
I have an excel spreadsheet that I download from a vendor that has the dates
listed as MAY/17/2010 - JUL/31/2011 and I am not able to use my existing
formula to figure out the number of months between two dates.

I was using =(YEAR(cell for end date)-YEAR(cell for start
date))*12+MONTH(cell for end date)-MONTH(cell for start date) which was
working great but now since the vendor changed their date format it won't
work. *I have even tried to format those cells to yyyy-mm-dd but they stay as
they are above.

Any help would be greatly appreciated because I don't want to have to retype
all the dates each time to get the month formula to work.

Thank you in advance.

Kim


If your start date is in cell A1 and the end date is in cell B1, the
following formula should work in place of the one you were previously
using:

=DATEDIF(DATEVALUE(SUBSTITUTE(SUBSTITUTE(A1,"/"," ",1),"/",",
")),DATEVALUE(SUBSTITUTE(SUBSTITUTE(B1,"/"," ",1),"/",", ")),"m")

Hope this helps,
Jason
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula to count no. of months between 2 dates Melissa Excel Discussion (Misc queries) 5 March 23rd 10 09:18 AM
formula to caluclate the # of years and months between two dates Alok Excel Worksheet Functions 0 November 30th 06 05:19 PM
formula to caluclate the # of years and months between two dates Sloth Excel Worksheet Functions 0 November 30th 06 04:01 PM
formula to caluclate the # of years and months between two dates Christyepd Excel Worksheet Functions 0 November 30th 06 03:36 PM
Formula to give 5%rise in a figure if it occurs b/wn 2 dates lwhat Excel Worksheet Functions 1 October 28th 05 11:21 AM


All times are GMT +1. The time now is 07:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"