Skip to content

How to Use Excel YEARFRAC Function?



YEARFRAC Function in Excel: Sometimes, we want to find the fraction of the year based on two specified dates. Doing this manually will lead to frustration because it is not an easy task for everyone. For that, Excel provides a special feature called the “YEARFRAC” function. With the help of this function, we can quickly calculate it in a few seconds.

Here, we will discuss the description, syntax, and usage of the YEARFRAC Function in Excel. Let’s step into this article!! Get an official version of MS Excel from the following link:

Excel YEARFRAC FunctionPin
Excel YEARFRAC Function

Description of YEARFRAC function

  • This is one of the built-in functions in Excel.
  • The YEARFRAC Function returns the fraction of the year by calculating the number of whole days between two dates.
  • You can make use of this function to calculate age, determine the proportion of a entire year’s obligations/benefits and more.


  • Here, you will see the syntax of the YEARFRAC function.
  • To apply this function on your spreadsheet, you have to select a cell and enter the formula in the following format.
  • Once you enter the formula, just click on the Enter button to get the result.

=YEARFRAC(start_date, end_date, [basis])

Parameters Explanation:

  • Start date (Required): The start date to be used in the calculation.
  • End date (Required): The end date to be used in the calculation.
  • Basis (Optional): The kind of day count basis to use.
BasisDay count basis
0 or omittedUS (NASD) 30/360
4European 30/360


Let’s look at some examples of the YEARFRAC function and explore how to use it in Microsoft Excel.

  • Initially, you have to open your Excel workbook on your PC and launch a worksheet that has data.
  • For example, we have entered the start date and end date in cells B3 & C3. We are going to calculate the fraction of the year using these two dates.
  • Now, we need to enter the above-mentioned formula to get the result.
Enter the formulaPin
Enter the formula
  • After entering the formula, you need to click the Enter button to get the output, as shown below.
  • In the following image, you can see the range of input dates. We will find the fraction of each date given below with the help of the YEARFRAC function.
Range of Input ValuesPin
Range of Input Values
  • Once you get the output value in the first cell, then you just need to drag down it to fill the remaining cells, as shown in the below image.


This post helped you to learn how to use the Excel YEARFRAC function in the spreadsheet with a few practical examples. If you have any queries/suggestions, kindly share it in the below comment box. To learn more about Excel functions, then visit our webpage

Video Tutorial

The following video will show you how to use the YEARFRAC function in the Excel spreadsheet.

Related Articles:


Leave a Reply

Your email address will not be published. Required fields are marked *

Share to...