+ Reply to Thread
Results 1 to 15 of 15

Count number of months between two dates

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2007
    Posts
    9

    Count number of months between two dates

    Dear All
    Hello once again,
    i have a problem again with one of Date Dif function " =DATEDIF(I5|J5|"m") " in attached file i have this function applied to calculate number of months in between two given dates but it seems this function is not working properly or i am missing some info in this to make it run properly, that where i need you experts guys help. please either help me to fix this function or give me a proper one which can solve my problem to calculate accurate months between these dates in attached file...
    i am greatly obliged..
    thanks all of you great guys out there who are helping the world in Excel..

    Kind Regards
    Attached Files Attached Files

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count number of months between two dates

    What results do you expect?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Count number of months between two dates

    Looks fine to me...

    Difference from Nov to Oct is 11. + 12 for one year = 23
    Difference from Oct to Dec is 2. + 3*12 = 38

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Count number of months between two dates

    That is what DATEDIF do:
    1-Nov-13 to 31-Oct-15 = 23 months and 30 days (/31 days) =>23 months
    Quang PT

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count number of months between two dates

    Result is correct. Also this formula gives the same result.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Probably you need to see this result
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count number of months between two dates

    Perhaps you want to count every month that is physically within the date range regardless of the actual date?

    If so, then try this one:

    =DATEDIF(B2-DAY(B2)+1,C2,"m")+1

  7. #7
    Registered User
    Join Date
    10-22-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Count number of months between two dates

    Thanks Toany for your reply
    i just need number of months in between both dates....

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count number of months between two dates

    Quote Originally Posted by Fotis1991 View Post

    Probably you need to see this result

    =DATEDIF(B2;C2,"m")+1
    That formula returns an incorrect result with this date range:

    2/29/2012 - 11/1/2012

    Formula returns 9 while the correct result should be 10.

  9. #9
    Registered User
    Join Date
    10-22-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Count number of months between two dates

    thanks Tony
    this one is working fine....
    thanks again

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count number of months between two dates

    You're welcome. Thanks for the feedback!

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count number of months between two dates

    Quote Originally Posted by Tony Valko View Post
    That formula returns an incorrect result with this date range:

    2/29/2012 - 11/1/2012

    Formula returns 9 while the correct result should be 10.
    Well done.

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count number of months between two dates

    ---------

  13. #13
    Registered User
    Join Date
    01-17-2014
    Location
    Pune, India
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Count number of months between two dates

    Hi All,

    I am trying to use this on 2010 it’s just not working. Facing a funny issue. When I copy past the formula from nadeem's file it works but when I tried to create it it refused.

    I am sorry if I am not supposed to use this thread for my query.

    I do apologise.
    here is the formula

    =DATEdif(F7,E7,"D")
    where in
    F7 21 April 2019
    E7 21 March 2012

    need to calculate number of days
    Last edited by neelesh4; 03-21-2014 at 12:55 PM. Reason: it worKS NOW :)

  14. #14
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Count number of months between two dates

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count number of months between two dates

    Answer deleted!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Count the number of months between 2 dates but only in a defined period
    By forrestgump1980 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 10-28-2014, 05:24 PM
  2. Replies: 8
    Last Post: 02-20-2014, 05:46 PM
  3. Number of months (elapsed months) between two dates
    By Timbite in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-17-2012, 11:37 AM
  4. Count Months Between Dates
    By jpgoeth in forum Excel General
    Replies: 3
    Last Post: 05-31-2007, 12:17 PM
  5. How to Count Months in a Column of Dates
    By Dexsquab in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-30-2006, 03:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1