DEV Community

Andrews
Andrews

Posted on • Originally published at geekexcel.com on

Excel Formulas to Calculate the Years Between Dates ~ Simple Tricks!!

Have you ever tried to calculate the number of years between two dates? Excel has the amazing function to achieve this job quickly. Let’s get into this article. This article provides some simple formulas to help you quickly get it done. Get an official version of ** MS Excel** from the following link: https://www.microsoft.com/en-in/microsoft-365/excel

Calculate number of years between two dates
Calculate the number of years between two dates

General Formula:

  • If you want to get the number of years between two dates, you can use the below formula.

=YEARFRAC(start_date,end_date)

Syntax Explanations:

  • YEARFRAC – This function helps to return the fraction of the year by calculating the number of whole days between two dates. Read more on the YEARFRAC function.
  • Start_date – It represents the starting date from your input range.
  • End_dat – It specifies the ending date from your input range.
  • Comma symbol (,) – It is a separator that helps to separate a list of values.
  • Parenthesis () – The main purpose of this symbol is to group the elements.

Practical Example:

Let’s consider the below example image.

  • Here, we will enter the input values in Column B and Column C.
  • Now we are going to find out the number of years based on the given input values.

Input Ranges
Input Ranges

  • So, apply the above-given formula to the formula bar section and press the ENTER key.

Enter the formula
Enter the formula

  • Finally, we will get the result in the selected cell.

Result
Result

Closure:

In this post, we have shown the simple formula to calculate the number of years between two dates in Excel. Hope you like it. Let me know if you have any doubts regarding this article or any other Excel/VBA topic.

Read Also:

Top comments (0)