Main Content

Fraction of year between dates

returns a fraction, in years, based on the number of days between dates
`YearFraction`

= yearfrac(`StartDate`

,`EndDate`

,`Basis`

)`StartDate`

and `EndDate`

using the given
day-count `Basis`

.

The number of days in a year (365 or 366) is equal to the number of days in the
calendar year after the `StartDate`

. If
`EndDate`

is earlier than `StartDate`

,
`YearFraction`

is negative.

All specified arguments must be number of instruments
(`NUMINST`

-by-`1`

) or
(`1`

-by-`NUMINST`

) conforming vectors or
scalar arguments.

`date2time`

| `datetime`

| `days360`

| `days365`

| `daysact`

| `daysdif`

| `months`

| `wrkdydif`

| `year`

| `year`

| `yeardays`