How to Use the YEARFRAC Function in Excel

Summary: Discover the capabilities of the YEARFRAC function in Microsoft Excel—an essential tool for calculating the fraction of years between two dates, using various day-count conventions. In this tutorial, tailored for data analysts with a passion for technology, explore step-by-step instructions to seamlessly integrate the YEARFRAC function into your data analysis toolkit.

The YEARFRAC function within Excel empowers you to calculate the fraction of years between two dates, considering different day-count conventions such as actual/actual, actual/360, and more. To harness the potential of this function, follow these comprehensive steps:

  1. Open Excel: Launch Microsoft Excel on your computer.

  2. Select a Cell: Choose the cell where you want to display the calculated year fraction using the YEARFRAC function.

  3. Enter the Formula: Input the following formula into the selected cell:

    =YEARFRAC(start_date, end_date, [basis])

    Replace "start_date" with the earlier date, "end_date" with the later date, and "[basis]" with the desired day-count basis (0 for actual/actual, 1 for actual/360, 2 for actual/365, and more).

  4. Press Enter: After entering the formula, press the Enter key to execute the function. The cell will display the calculated fraction of years between the specified dates based on the selected day-count basis.

  5. Example: Suppose you want to calculate the year fraction between January 1, 2020, and August 9, 2023, using the actual/360 day-count basis. Use this formula:

    =YEARFRAC("2020-01-01", "2023-08-09", 1)
  6. View Calculated Year Fraction: The cell will now display the calculated year fraction, such as "3.594444444," which corresponds to the fraction of years between the specified dates using the selected day-count basis.

Summary: By mastering the YEARFRAC function in Excel, you can effortlessly calculate the fraction of years between two dates, considering various day-count conventions. By following the systematic instructions outlined in this tutorial, you can adeptly incorporate this function into your data analysis endeavors.

Feel free to ask questions or share your thoughts, fostering further exploration of this topic.

Note: The YEARFRAC function is available in various versions of Microsoft Excel, including Excel 2013, Excel 2016, Excel 2019, and Microsoft 365.

Previous
Previous

How to Use the BESSELI Function in Excel

Next
Next

How to Use the YEAR Function in Excel