Difference between revisions of "Documentation/How Tos/Calc: YEARFRAC function"
From Apache OpenOffice Wiki
< Documentation | How Tos
OOoWikiBot (Talk | contribs) m (Robot: Automated text replacement %s) |
m |
||
Line 43: | Line 43: | ||
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]] | * [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]] | ||
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}} | * [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}} | ||
− | [[Category: Documentation/Reference/Calc]] | + | [[Category: Documentation/Reference/Calc/Date and Time functions]] |
Revision as of 06:55, 13 April 2010
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:
basis | day counting system |
---|---|
0 | US (NASD) system. 30 days/month, 360 days/year (30/360) |
1 | Actual/actual |
2 | Actual/360 |
3 | Actual/365 |
4 | European 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.
Issues:
- Excel and Calc both produce slightly erroneous results in some circumstances.