Difference between revisions of "Documentation/How Tos/Calc: YEARFRAC function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE: YEARFRAC function}}
 +
{{Documentation/CalcFunc DateTimeTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_EASTERSUNDAY_function
 +
|NextPage=Documentation/How_Tos/Calc:_Financial_functions
 +
}}__NOTOC__
  
 
== YEARFRAC ==
 
== YEARFRAC ==
Line 15: Line 20:
 
|align="center"|0||US (NASD) system. 30 days/month, 360 days/year (30/360)
 
|align="center"|0||US (NASD) system. 30 days/month, 360 days/year (30/360)
 
|-
 
|-
|align="center"|1||Actual/actual (Euro), also known as AFB
+
|align="center"|1||Actual/actual
 
|-
 
|-
 
|align="center"|2||Actual/360
 
|align="center"|2||Actual/360
Line 23: Line 28:
 
|align="center"|4||European 30/360
 
|align="center"|4||European 30/360
 
|}
 
|}
 
  
 
=== Example: ===
 
=== Example: ===
Line 32: Line 36:
 
: returns <tt>'''0.498630136986'''</tt>.
 
: returns <tt>'''0.498630136986'''</tt>.
  
 +
=== Issues: ===
 +
* Excel and Calc both produce slightly erroneous results in some circumstances.
 +
 +
{{SeeAlso|EN|
 +
* [[Documentation/How_Tos/Calc: Date & Time functions#Financial date systems|Financial date systems]]
  
 +
* [[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]
  
=== See also: ===
+
* [[Documentation/How_Tos/Calc: Date & Time functions|Date & Time functions]]
'''[[Documentation/How_Tos/Calc: Date & Time functions|Date & Time functions]]'''
+
  
'''[[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]'''
+
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 +
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 +
[[Category: Documentation/Reference/Calc/Date and Time functions]]

Latest revision as of 14:11, 30 January 2024



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.



See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_YEARFRAC_function&oldid=259713"
Views
Personal tools
Navigation
Tools