Months Between Two Dates

Solution 1:

Here is a single cell formula considering also possible year differences:

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

enter image description here

Solution 2:

Try this formula:

=DATEDIF(A2,B2,"M")

enter image description here

Solution 3:

I would like to suggest two possible methods:

enter image description here

  • Formula for method 1 in cell B75, list of months includes Start Month:

    =IF(DATE(YEAR($A$75),MONTH($A$75)+ROW(1:1)-1,1)<$A$76,DATE(YEAR($A$75),MONTH($A$75)+ROW(1:1)-1,1),"")
    

  • Formula for method 2:

Option 1: If start month is included.

  • Formula in cell D75: =EDATE(A75,0)
  • Formula in cell D76: =IFERROR(IF(EDATE(D75,1)>$A$76,"",EDATE(D75,1)),"")

Option 2: If start month is excluded.

  • Formula in cell E75: =EDATE(A75,1)
  • Formula in cell E76: =IFERROR(IF(EDATE(E75,1)>=$A$76,"",EDATE(D75,1)),"")

::Edited::

You may skip Method 2, and write this formula in cell C75 to get months, excludes Start Month.

 =IF(DATE(YEAR($A$76),MONTH($A$76)+ROW(1:1)-0,1)<$A$77,DATE(YEAR($A$76),MONTH($A$76)+ROW(1:1)-0,1),"")

- Adjust cell references in the formula as needed.