Documentation/How Tos/Calc: YEARFRAC function

From OpenOffice.org Wiki

Jump to: navigation, search


YEARFRAC

Returns the number of years including fraction between two dates.

This function is only available if the Analysis AddIn is installed.

Syntax:

YEARFRAC(startdate; enddate; basis)

returns the number of years between the startdate and enddate; basis is an integer specifying the system of how many days are in a month or year, as follows:
basisday counting system
0US (NASD) system. 30 days/month, 360 days/year (30/360)
1Actual/actual
2Actual/360
3Actual/365
4European 30/360

Example:

YEARFRAC("2007-01-01";"2009-07-01";0)

returns 2.5.

YEARFRAC("2008-01-01";"2008-07-01";3)

returns 0.498630136986.

See also:

Date & Time functions

Date & Time overview

Issues:

  • Excel and Calc both produce slightly erroneous results in some circumstances.
Personal tools
Collection