Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Format Cell in Months

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Subtracting two dates and would like the answer to be in months.

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    =DATEDIF(A1,B1,"M")

  3. #3
    MrExcel MVP Joe Was's Avatar
    Join Date
    Feb 2002
    Location
    Central Florida, USA
    Posts
    7,539
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    =IF(OR(F13="",F16=""),"Enter Both Dates Above!", DATEDIF(F13,F16,"ym")& " months")

    This will give only the months portion of the between date. It will not convert the years to month though.

    Like: 2 years 3 months will = 3 months, not 27 months!

    And:

    =IF(OR(F13="",F16=""),"Enter Both Dates Above!", DATEDIF(F13,F16,"m")& " months")

    will give you your 27 months for 2 years and 3 months. Hope this helps. JSW

    [ This Message was edited by: Joe Was on 2002-04-26 08:40 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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