How to calculate years between two dates in Excel

All aspects of life revolve around time. All daily activities we do in our life also depend and revolve on time. We all need to keep track of time because it is a temporary situation. Time is measured or accounted for in seconds, minutes, hours, days, weeks, months, and years.

To calculate years between years is the general act of getting the number or the value in years between two given dates. We can do that simply by getting the difference between the dates or even by the manual counting of the number of months involved and then translating the months to years.

In excel sheets we also calculate the years that are there in the middle of two dates or even three dates. Unlike manual counting, excel has these built-in formulas that help in the calculating of the years.

We have some of the steps to follow to reach a value of the years between the given dates. These steps will include the following and are explained below together with the examples.

How to calculate Years between two dates

Step 1

Assuming you have the data set already in the excel sheets you do not have to redo the first step again. For those who are doing it for the first time, open the excel from your laptop, create a new or an empty excel sheet, and record the date values of your choice as in the case below.

Step 2

To get the years between the dates on the above excel sheets, we are going to use the function YEARFRAC. This is the function that calculates the years between dates. One thing about the YEARFRAC function is that it can calculate even in decimal, for instance, it can display 1.5 years to mean one and a half years.

On the column with the header, years are where we expect to record our results. Enter the following formula in the formula bar =YEARFRAC (A2, B2) to calculate the years between the dates in cell A2 and cell B2.

Use the same formula for the rest of the cells or hold and drag the cursor to automatically calculate the rest of the years.

How to calculate the difference of full years between two dates

The above formula calculates the years as decimals in case it's not full. But sometimes you may be looking to calculate full years only. In this case, we are going to use the function DATEDIF(Start date, end date, "y")

For example, let's use the same dates as above:

1. Type =DATEDIF(A2, B2,"y") on the cell that you want to display the results and press Enter. 

2. Drag the formula to calculate the year difference of the remaining cells

As you can see, this function has calculated only the full years.

How to calculate the difference in months

To calculate the difference between two dates in months we use the function =DATEDIF(start_date,end_date,"m")

M in this function represents a full month

How to calculate the difference in weeks

The formula for calculating the difference between two dates in weeks is: =DATEDIF(Start_date,End_date,"d")/7

"d" represents the number of days while "/7" converts the days to weeks

How to calculate the difference in days

Use the following formula to calculate the difference between two dates in days


d represents days in the formula

%d bloggers like this: