YEARFRAC function for Sheets

YEARFRAC function for Sheets

1 min read
I. Intro
You can use the YEARFRAC function to calculate the fractional years between two dates.
II. About the function
  • Formula: =YEARFRAC(start date, end date, [basis]).
  • Parameters:
  • Start date (required): The start date of the period. It must be one of the following: a reference to a cell containing a date, a function returning a value in a date format, or an integer.
  • End date (required): The end date of the period. It must be one of the following: a reference to a cell containing a date, a function returning a value in a date format, or an integer.
  • Basis (optional): The calculation method to be used, as explained below.
Basis
Calculation
0 or blank
US (NASD) calculation
One month = 30 days/One whole year = 360 days.
1
The actual number of days in the month/year.
2
The actual number of days in the month/One whole year = 360 days.
3
The actual number of days in the month/One whole year = 365 days.
4
European calculation method that adjusts the last day of the month.
One month = 30 days/One whole year = 360 days.
  • Example:
  • In a cell enter =YEARFRAC(DATE(2021,7,16),DATE(2021,7,24),1).
  • The formula will return the fractional year between these two dates.
  • Calculation method: The actual number of days in the month/year.
III. Steps
  1. Select the cell and click Formula in the toolbar, select All functions, and search for YEARFRAC. You can also directly enter =YEARFRAC in a cell.
  1. In a cell, enter =YEARFRAC("2021/1/1","2021/6/30"). You can use this function in combination with the DATE function to convert numbers to dates like this: =YEARFRAC(DATE(2021,1,1),DATE(2021,6,30),1). This will return the fractional year between these dates. Calculation method: The actual number of days in the months (January to June)/year (2021).
  1. Press Enter to display the result. You can change the decimal value to percentages by changing the cell format in the toolbar.
250px|700px|reset
Written by: Lark Help Center
Updated on 2022-10-08
How satisfied are you with this content?
Thank you for your feedback!
Need more help? Please contact Support.
0
rangeDom