< Go Back

Calculate years between dates

How to Calculate years between dates?

We can calculate years between dates in excel by using –=YEARFRAC().

What is YEARFRAC()?

YEARFRAC() is a function that returns the days between two dates as a year fraction.

Formula

=YEARFRAC(start_date,end_date)

Let us go through an example to understand it better.

How to use the Formula to Calculate years between dates?

Figure 1. Example 1 of YEARFRAC() to Calculate years between dates

In this example, you have a small table containing starting and ending dates. To apply YEARFRAC() on this table:

  1. Select any column, where you want to display years between dates for any starting and ending dates. In this case it is H5.
  2. In the function box, type YEARFRAC() FUNCTION.
  3. Give the arguments i.e. the starting and ending date. For H5, assign the  F5:G5. Since the dates have the same year so, the answer is less than 1.

An alternative way to calculate years between dates

Figure 2. Example 1 of DATEDIF() to calculate years between dates

You can also calculate years between dates by using DATEDIF() function. Let’s see how to do this:

  1. Select any column, where you want to display years between dates for any starting and ending dates. In this case, it is H5.
  2. In the function box, type DATEDIF() FUNCTION.
  3. Give the arguments i.e. the starting, ending date and “Y” to tell the function to give out years. For H5, assign the  F5:G5.
  4. Since the dates have the same year so, the answer is 0. The YEARFRAC() returns fraction but this formula returns the whole number.
Our customers love us!
“The expert was absolutely amazing and stuck with me the whole way through. They were polite, patient, seemed to want to genuinely help me and provided a solution that I would never have managed otherwise. I could not be more thankful for their support and solution. Thank you!” - - Chris T, in California

Leave a Comment

avatar