YEARFRAC

Formulas / YEARFRAC
Calculate the fraction of a year between two dates.
YEARFRAC(start_date, end_date, [basis])
  • start_date - required, start date of the period
  • end_date - required, end date of the period
  • basis - [OPTIONAL] specifies the type of day count basis to use

Examples

  • =YEARFRAC("1-Jan-2018","1-Jan-2019")

    The YEARFRAC function can be used to calculate the number of years between two dates and, will return 1, which represents one full year.

  • =YEARFRAC(DATE(YEAR(TODAY()),1,1),TODAY())

    The YEARFRAC function can also be used to calculate the number of years between a current date and the beginning of the year. For example, this formula returns the number of years between the beginning of the current year and the current date.

  • =YEARFRAC(A1,B1)

    The YEARFRAC function can also be used to calculate the number of years between two arbitrary dates, and returns a decimal number representing the number of years between two dates stored in cells A1 and B1. The returned number can also be formatted as a percentage.

Summary

The YEARFRAC function is used to calculate the fraction of a year represented by a period of time. It can calculate the proportion of a year's benefits or obligations during a specified period.

  • The YEARFRAC function is a useful tool for calculating the fraction of a year between two dates.
  • It can be used to accurately calculate the number of days, months, or years between two dates.
  • The DAYS360 function is an alternative to the YEARFRAC function. It calculates the fraction of a year between two dates by using a 360-day year.


Frequently Asked Questions

What is the YEARFRAC function?
The YEARFRAC function is a date/time function that returns the number of days between two dates as a year fraction.
What does the basis argument do?
The basis argument determines the type of day count basis used.
What are the different day count basis options?
The different day count basis options are:
  • 0 or omitted - US (NASD) 30/360
  • 1 - Actual/actual
  • 2 - Actual/360
  • 3 - Actual/365
  • 4 - European 30/360
Sourcetable Logo

Work smarter

Al is here to help. Leverage the latest models to
analyze spreadsheets, enrich data, and create reports.

Drop CSV