Yearfrac
- 18 May 2022
- 1 Minute to read
- DarkLight
- PDF
Yearfrac
- Updated on 18 May 2022
- 1 Minute to read
- DarkLight
- PDF
Article Summary
Returns the difference in years between the given two datetimes. Fractional year differences are represented as a decimal number.
Optionally, you can change the convention for how the number of days in a year is counted.
Function signature
YEARFRAC(datestart: String, dateend: String, basis: String = us_nasd) => Number
Parameter | Description |
---|---|
Date start | The start date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number. |
Date end | The end date to consider in the calculation. Must be a reference to a cell containing a date, a function returning a date type, or a number. |
Basis | Method to use for counting days per month/year:
|
Examples
Formula | Return value |
---|---|
YEARFRAC("2010-01-22T13:06:15+03:00", "2000-01-01T13:06:15+03:00") | 10.05833333 |
YEARFRAC("2013-01-23T13:06:15+03:00", "2004-02-03T13:06:15+03:00", "actual_360") | 9.10277778 |
YEARFRAC("2016-01-25T13:06:15+03:00", "2008-03-07T13:06:15+03:00", "actual_365") | 7.89041096 |
YEARFRAC("2019-01-26T13:06:15+03:00", "2012-04-09T13:06:15+03:00", "european") | 6.79722222 |
Was this article helpful?