• Home
  • YEARFRAC Function

YEARFRAC Function

The YEARFRAC function is one of the date and time functions. It is used to return the fraction of a year represented by the number of whole days from start-date to end-date calculated on the specified basis.

Syntax

YEARFRAC(start_date, end_date, [basis])

The YEARFRAC function has the following arguments:

ArgumentDescription
start_dateA number representing the first date of the period, entered using the DATE function or other date and time function.
end_dateA number representing the last date of the period, entered using the DATE function or other date and time function.
basisThe day count basis to use, a numeric value greater than or equal to 0, but less than or equal to 4. The possible values are listed in the table below.

The basis argument can be one of the following:

Numeric valueCount basis
0US (NASD) 30/360
1Actual/actual
2Actual/360
3Actual/365
4European 30/360
Notes

If the start_date, end_date or basis is a decimal value, the function will ignore the numbers to the right of the decimal point.

How to apply the YEARFRAC function.

Examples

The figure below displays the result returned by the YEARFRAC function.

YEARFRAC Function

Host ONLYOFFICE Docs on your own server or use it in the cloud

Article with the tag:
Browse all tags