## Excel Formula: Count Months Between Two Dates

In this tutorial, it provides formulas to count months between two given dates.

### Get number of complete months between dates

Generic formula:

 DATEDIF(start_date,end_date,”M”)

Syntaxt and Arguments

 Start_date, end_date: the two dates that you want to get months difference between.

Return Value

The formula returns a whole numeric value that indicates the number of months.

Error Value

1 While the start_date is greater than the end_date, the formula returns an error value #NUM!

2 While the start_date or end_date is not valid dates (a text value or not a valid date in Excel such as dates before 1/1/1900), the formula returns an error value #VALUE!

How this formula works

To count the number of months between dates in cell B3 and C3, please use below formula:

 =DATEDIF(B3,C3,"M")

Press Enter key and drag fill handle over the cells that need this formula.

Explanation

DATEDIF function: returns the number of complete years, months or days between dates.

Remark

The formula calculates and round the number of months down, if you want to get the nearest whole month, you can use the formula as this:

 DATEDIF(start_date,end_date+15,"M")

### Get number of decimal months between dates

Generic Formula

 YEARFRAC(date1,date2)*12

Syntax and Arguments

 Date1, date2: the two dates that you count the number of months based on.

Return Value

The formula returns a value in date format, and you need to format the result as number.

How the formula works

To count the months between the dates in cell B3 and C3, please use the formula as this:

 =YEARFRAC(C3,B3)*12

Press Enter key then drag fill handle down to the cells for applying this formula.

Keep the formula result selected, and press Ctrl + 1 to display the Format Cells dialog, then under Number tab, click Date from the Category list, choose the date type you want to display in the Type section.

Click OK, the result is shown as date.

Explanation

YEARFRAC function: calculates the fractional year in a decimal format between given dates. Basic formula is YEARFRAC(date1,date2), to multiply 12 at the end of the formula, will get the fractional months in a decimal format between dates.

Remark

If you want to get the whole number of months by the YEARFRAC function, you can add the INT function in the front of the YEARFRAC function like this:

 INT(YEARFRAC(date1,date2)*12)

It counts month rounded down.

### The Best Office Productivity Tools

#### Kutools for Excel - Helps You To Stand Out From Crowd

 🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions… Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ... Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup... Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List... Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Columns to Select Same & Different Cells ... Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ... Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

#### Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

• One second to switch between dozens of open documents!
• Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
• Increases your productivity by 50% when viewing and editing multiple documents.
• Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.