How can I calculate the number of years and months between two dates using Excel?

Calculating the number of years and months between two dates can be easily done using Excel. This feature allows you to accurately determine the time difference between two specific dates for various purposes such as financial planning or project management. To do this, simply enter the two dates into separate cells in the format of “MM/DD/YYYY”. Then, use the formula “=DATEDIF(start_date,end_date,”YM”)” where the start_date and end_date are the respective cells containing the dates. This will give you the number of months between the two dates. To calculate the number of years, use the formula “=DATEDIF(start_date,end_date,”Y”)” which will provide the number of whole years between the two dates. This simple and efficient method in Excel can be used for various date calculations, saving time and effort.

Excel: Calculate Years & Months Between Two Dates


You can use the following formula to calculate the number of years and months between two dates in Excel:

=DATEDIF(A2, B2,"y")&" years "&DATEDIF(A2, B2,"ym")&" months"

This particular formula will return the number of years and months between the start date in cell A2 and the end date in cell B2.

For example, if cell A2 contains 1/4/2005 and cell B2 contains 1/1/2022 then this formula will return 16 years 11 months.

The following examples show how to use each formula in practice.

Example: Calculate Years & Months Between Two Dates in Excel

Suppose we have the following list of start and end dates in Excel:

Suppose we would like to calculate the number of full years and months between the start and end dates in each row.

We can type the following formula into cell B2 to do so:

=DATEDIF(A2, B2,"y")&" years "&DATEDIF(A2, B2,"ym")&" months"

We can then click and drag this formula down to each remaining cell in column B:

Excel calculate years and months between two dates

Column C now displays the number of full years and months between the start date and end date in each row.

Note that you can also format the output in a different way if you’d like.

For example, you could use the following formula to add a comma between the years and months:

=DATEDIF(A2, B2,"y")&" years, "&DATEDIF(A2, B2,"ym")&" months"

The years and months now have a comma in between them in the output of column C.

Note: You can find the complete documentation for the DATEDIF function in Excel .

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

x