+ Reply to Thread
Results 1 to 8 of 8

number of months from one date to another

  1. #1
    Registered User
    Join Date
    04-29-2010
    Location
    Gympie, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    number of months from one date to another

    Could someone please tell me how to modify this formula to calculate the number of months from one date to another?

    =DATEDIF(A1,TODAY(),"m")

    Regards Ken
    Last edited by kengaroo; 04-29-2010 at 09:06 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: number of months from one date to another

    replace today() with an actual date

    =DATEDIF(A1,B1,"m")

  3. #3
    Registered User
    Join Date
    04-29-2010
    Location
    Gympie, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: number of months from one date to another

    Yes, thank you. I meant to ask months and days. Is this possible?
    Also, am I asking these questions in the right area?
    Your help is very appreciated.
    Regards Ken

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: number of months from one date to another

    Yes it is in the wrong spot, it should be in worksheet functions

    Try This

    =DATEDIF(A1,B1,"ym")&" months "&DATEDIF(A1,B1,"md")&" days"

  5. #5
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: number of months from one date to another

    replace today() with an actual date
    Just curious as to why. The formula will return the correct result when using the TODAY() function.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: number of months from one date to another

    Did you place today's date in B1?

  7. #7
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: number of months from one date to another

    Yes. The formula works - however, as expected, it returns a result of - 0 month 0 days, but it does not error.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: number of months from one date to another

    Quote Originally Posted by davesexcel View Post
    =DATEDIF(A1,B1,"ym")&" months "&DATEDIF(A1,B1,"md")&" days"
    Of course if the period is over a year and you want to show a result like 15 months 11 days then the first DATEDIF should use 3rd argument of just "m", i.e.

    =DATEDIF(A1,B1,"m")&" months "&DATEDIF(A1,B1,"md")&" days"

    otherwise you never get greater than 11 months 30 days

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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