Difference between revisions of "YearFrac"

 
Line 1: Line 1:
 +
[[Category:Date and Time Functions]]
 +
''New to [[What's new in Analytica 4.2?|Analytica 4.2]]''
 +
 
= YearFrac(startDate,endDate'',basis'') =
 
= YearFrac(startDate,endDate'',basis'') =
  

Revision as of 05:44, 6 March 2009

New to Analytica 4.2

YearFrac(startDate,endDate,basis)

Calculates the fractional number of years elapsed between startDate and endDate, based on various artificial year standards that are sometimes used with financial instruments and obligations. The result is always positive, with the result being the span between the lesser of the two dates and the greater of the two dates.

The basis specifies the method used to measure the fractional portion of the year. The possible values for basis are as follows:

  • 0 (or omitted) = US (NASD) 30/360
  • 1 = actual/actual
  • 2 = Actual/360
  • 3 = Actual/365
  • 4 = European 30/360

The function is implemented to match the results computed by Excel 2003 for dates after 1900.

«startDate» and «endDate» are numeric, representing the number of days elapsed since the date origin. If these are fractional (e.g., with a time component), they are truncated to an integer date. You can use the function MakeDate to create a date within an expression, or you can enter a single date into a definition or table cell when the number format for that variable is set to date.

See Also

Comments


You are not allowed to post comments.