Difference between revisions of "Manuals/calci/YEARFRAC"
(Created page with "<div id="6SpaceContent" class="zcontent" align="left"> '''YEARFRAC'''(SomeFrom, SomeTo, SomeBasis) where, '''SomeFrom''' - is a date that represents the start date. ...") |
|||
| (7 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
| − | <div | + | <div style="font-size:30px">'''YEARFRAC (From,To,Basis)'''</div><br/> |
| − | + | where | |
| + | *<math>From</math> represents a start date, | ||
| + | *<math>To</math> represents an end date, and | ||
| + | *<math>Basis</math> is the type of day count basis to use. | ||
| + | **YEARFRAC() calculates the fraction of the year depending on the number of days between start date and end date. | ||
| − | + | == Description == | |
| − | + | YEARFRAC(From,To,Basis) | |
| − | ''' | + | *YEARFRAC() returns the fractional proportion of the year from specified start and end dates. |
| + | *<math>From</math> and <math>To</math> dates should be entered either in 'date format' or 'dates returned using formulas'. If dates are not valid, Calci displays #N/A error message. | ||
| + | *<math>From</math> date should be < <math>To</math>, else Calci displays NaN error message. | ||
| + | *<math>Basis</math> value is optional. If omitted, Calci assumes it to be 0. | ||
| + | *We can use the DD/MM/YYYY format also. For Example:"14/5/2005[DD/MM/YYYY]". | ||
| + | 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. | |
| + | *We can use range values also.For Example :YEARFRAC(DATE(2014,1,1),#4/1/2015-4/1/2020) | ||
| − | + | == Examples == | |
| − | + | YEARFRAC (From,To,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" | | |
| − | + | |} | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | YEARFRAC | + | =YEARFRAC(A1,A2,A3) : Calculates the fraction Value of the year with the inputs <br />in the range A1 to A3. Returns '''0.7666666666666667''' as a result. |
| + | =YEARFRAC(DATE(2014,1,1),DATE(2014,4,1)) : Calculates the fraction Value of the year <br />within the dates mentioned. Returns '''0.25''' as a result. | ||
| + | =YEARFRAC(DATE(2014,1,1),DATE(2015,4,1)) : Calculates the fraction Value of the year <br />within the dates mentioned. Returns '''1.25''' as a result. | ||
| + | =YEARFRAC("1/1/2014[DD/MM/YYYY]","14/4/2015[DD/MM/YYYY]") = 1.2861111111111112 | ||
| − | + | ==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 ]] | |
| − | |||
Latest revision as of 14:22, 22 August 2018
YEARFRAC (From,To,Basis)
where
- represents a start date,
- represents an end date, and
- is the type of day count basis to use.
- YEARFRAC() calculates the fraction of the year depending on the number of days between start date and end date.
Description
YEARFRAC(From,To,Basis)
- YEARFRAC() returns the fractional proportion of the year from specified start and end dates.
- and dates should be entered either in 'date format' or 'dates returned using formulas'. If dates are not valid, Calci displays #N/A error message.
- date should be < , else Calci displays NaN error message.
- value is optional. If omitted, Calci assumes it to be 0.
- We can use the DD/MM/YYYY format also. For Example:"14/5/2005[DD/MM/YYYY]".
Below table shows the use of values:
| Basis | Description |
|---|---|
| 0 | US (NASD) 30/360 |
| 1 | Actual/actual |
| 2 | Actual/360 |
| 3 | Actual/365 |
| 4 | European 30/360 |
- If value is other than 0 to 4, Calci displays #N/A error message.
- We can use range values also.For Example :YEARFRAC(DATE(2014,1,1),#4/1/2015-4/1/2020)
Examples
YEARFRAC (From,To,Basis) function with inputs in order is calculated as follows:
| 1/4/2008 | |
| 10/10/2008 | |
| 4 |
=YEARFRAC(A1,A2,A3) : Calculates the fraction Value of the year with the inputs
in the range A1 to A3. Returns 0.7666666666666667 as a result. =YEARFRAC(DATE(2014,1,1),DATE(2014,4,1)) : Calculates the fraction Value of the year
within the dates mentioned. Returns 0.25 as a result. =YEARFRAC(DATE(2014,1,1),DATE(2015,4,1)) : Calculates the fraction Value of the year
within the dates mentioned. Returns 1.25 as a result. =YEARFRAC("1/1/2014[DD/MM/YYYY]","14/4/2015[DD/MM/YYYY]") = 1.2861111111111112
Related Videos
See Also
References