2,260 bytes added
, 03:02, 18 March 2017
=YEARBASIS(Date, Basis)=
where
*<math>Date</math> represents a start date, and
*<math>Basis</math> is the type of day count basis to use.
YEARBASIS() calculates the number of days in the year for the mentioned date with respect to basis count.
== Description ==
YEARBASIS(Date, Basis)
*YEARBASIS() returns the number of days in the year for the mentioned date with respect to basis count.
*<math>Date</math> should be entered either in 'date format' or 'date returned using formula'. If date is not valid, Calci displays #N/A error message.
*<math>basis</math> value is optional. If omitted, Calci assumes it to be 0.
Below table shows the use of <math>basis</math> values:
{| class="wikitable"
|-
! Basis !! Description
|-
| 0 || US (NASD) 30/360
|-
| 1 || Actual/actual
|-
| 2 || Actual/360
|-
| 3 || Actual/365
|-
| 4 || European 30/360
|}
*If <math>basis</math> value is other than 0 to 4, Calci displays #N/A error message.
== Examples ==
YEARBASIS(Date, Basis) function with inputs in order is calculated as follows:
<div id="2SpaceContent" class="zcontent" align="left">
{| id="TABLE3" class="SpreadSheet blue"
|- class="even"
| class="sshl_f" | 1/4/2008
| class="sshl_f" |
|- class="odd"
| class="sshl_f" | 10/10/2008
| class="sshl_f" |
|- class="even"
| class="sshl_f" | 4
| class="sshl_f" |
|}
=YEARBASIS(A1,A3) : Calculates . Returns '''360''' as a result.
=YEARBASIS(A2,A3) : Calculates . Returns '''360''' as a result.
=YEARBASIS(DATE(2014,1,1),0) : Calculates . Returns '''360''' as a result.
=YEARBASIS(DATE(2014,1,1),1) : Calculates . Returns '''365''' as a result.
=YEARBASIS(DATE(2014,1,1),2) : Calculates . Returns '''360''' as a result.
=YEARBASIS(DATE(2014,1,1),3) : Calculates . Returns '''365''' as a result.
=YEARBASIS(DATE(2014,1,1)) : Calculates with Basis omitted. Returns '''360''' as a result.
==Related Videos==
{{#ev:youtube|kKx9UXyCsO4|280|center|YEARFRAC}}
== See Also ==
*[[Manuals/calci/YEAR | YEAR]]
== References ==
*[http://en.wikipedia.org/wiki/Date_format_by_country Date Formats]
*[http://en.wikipedia.org/wiki/Calendar_year Calendar Year]
*[http://en.wikipedia.org/wiki/Day_count_convention Basis Convention]
*[[Z_API_Functions | List of Main Z Functions]]
*[[ Z3 | Z3 home ]]