Calculation of the number of months (even incomplete) between two dates

Solved
Matthous Posted messages 3 Status Member -  
Matthous Posted messages 3 Status Member -
Hello,

I'm looking to calculate the number of months that have elapsed between two dates in Excel or Google Sheets, starting from the month of the first date, even if the month is incomplete.

For example:
- Start date: 26/03/2016
- End date: 04/07/2016
- Result: 5 months

I've already tried using DATEDIF, calculating days/30 with ROUND, but it's not working.

Do you have any suggestions, please?

Thank you,

Configuration: Windows 7 / Chrome 51.0.2704.103

2 answers

  1. eriiic Posted messages 24581 Registration date   Status Contributor Last intervention   7 281
     
    Hello,

    =YEAR(B2)*12+MONTH(B2)-YEAR(A2)*12-MONTH(A2)+1

    eric

    By continually trying, we eventually succeed.
    So the more it fails, the more chances we have that it will work. (the Shadoks)
    In addition to thank you (yes, it happens!!!), remember to put it in resolved. Thank you.
    2
    1. Matthous Posted messages 3 Status Member
       
      It works, thank you very much :D
      0
  2. The_boss_68 Posted messages 959 Registration date   Status Member Last intervention   183
     
    Hello,

    I don't understand your result of 5 months for a start date of 26/03/2016 & end date of 04/07/2016 = 3 months and 8 days

    Maybe an idea: formula to put in C1 for a start date in A1 and an end date in B1
    =DATEDIF(A1,B1,"y")&" Years "&DATEDIF(A1,B1,"ym")&" Months "&DATEDIF(A1,B1,"md")&" Days"

    Or
    =DATEDIF(A1,B1,"ym")&" Months "
    0
    1. Matthous Posted messages 3 Status Member
       
      Hello,

      Thank you for your response.

      The result of 5 months does not represent the number of months between the two dates, so in relation to the example, the first date is in March and the last is in July. The figure I need is the number of months between March and July, which is 5 (March and July included).
      0