What the name means | "Difference in Years"
| Syntax | DiffY ( Date1, Date2, [DayCount], [Periods] )
| Description | Calculates the difference in years between two dates as Date2 - Date1
| See also Excel functions | YEARFRAC (Related)
|
| Variable | Type or Value | Description |
Inputs: (4)
|
1
| Date1
| Date
| One of 2 or more dates, and the lowest or earliest date
|
2
| Date2
| Date
| One of 2 or more dates
|
3
| DayCount
| Float (Optional)
| Either a single number denoting the DayCount method, or a number in the form ww.ss where ww is the daycount of whole periods and ss applies to stub periods. See Using Daycount.
(Optional)
|
4
| Periods
| Annual Sequence (Optional)
| Either an option number, or a range of floats, describing the accruals periods or the timing of cash payments, in the format mm.dd for payments in advance or -mm.dd for payments in arrears. See Using Daycount
(Optional)
|
Output:
|
Return Value
| Yrs
| Float
| A number of years.
|
Defaults and Values The variable(s) of this function have certain defaults and/or switch values associated with them. Click here to see more. Type of Value | Value | Description | Detail | Default(s)
| DayCount | 5 | Decimal Year (ACTM/12): ActualMonths / 12
| | Periods | 4 | Calendar quarters (1.01, 4.01, 7.01, 10.01) | Switches
| DayCount | 0 | 30/360 BMA (Bond Market Association, formerly the PSA)
| | | 1 | ACT/ACT (365 or 366)
| | | 2 | ACT/360: ActualDaysInPeriod / 360
| | | 3 | ACT/365: ActualDaysInPeriod / 365
| | | 4 | 30E/360: Also known as European 30/360. Standard bond literature definition.
| | | 5 | Decimal Year (ACTM/12): ActualMonths / 12
| | | 6 | ACT/ACT (in period)
| | | 7 | 30/360 BMA (Bond Market Association, formerly the PSA)
| | | 8 | ACT (Non Leap)/365: Same as ACT/365 but ignoring Feb 29
| | | 9 | 30/365: Standard bond literature definition (same as 30/360 but with 365 denominator)
| | | 10 | 30/360 ISDA
| | | 11 | 30/360 ISDA + Feb Adj
| | | 12 | ISDA + Feb EOM Adj
| | | 13 | Brazilian ACTBD/252
| | | -12 | Monthly in arrear, calendar months {1st Jan payment for Dec accrual, Feb 1 payment for Jan accrual etc}
| | | -4 | Quarterly in arrear, calendar quarters (1st April for Jan-March accrual, 1st Jul payment for April-June accrual, etc)
| | | -2 | 6 monthly in arrears (1st Jan payment for Jul-Dec accrual,1st July payment for Jan-June accrual )
| | | -1 | Annually In Arrear 1st Jan payment for Jul-Dec accrual
| | | 1 | Annually, 1st Jan
| | | 2 | 6 monthly (1st Jan, 1st July)
| | | 4 | Calendar quarters (1.01, 4.01, 7.01, 10.01)
| | | 12 | Calendar months {1.01, 1.02 etc}
| | | 13 | Real Estate English Quarter Days:25th March, 24th June, 29th September and 25th December of each year ie {3.25,6.24,9.29,12.25}
| | | 14 | Continuous (could be thought of as daily) |
Whats good or unique about it | Although this gives exactly the same results as Excel's YEARFRAC function for DayCount types 0-4, this function extends the DayCount options in two ways:
- It includes type 5, ACTM/12
- It includes type 6 ACT/ACT(in period) and allows you to specify the Daycount periods in the Periods variable.
In addition, Excel's YEARFRAC function always reports a positive, whereas DiffY reports a negative if Date1>Date2. |
Examples | - Preview of the DiffY example.
- The above spreadsheet can be accessed from the Quick Reference (on the Business Functions menu), on the Examples menu, or in the Business Functions\Component Examples directory
|
Published Edition Changes in Behaviour This function has experienced some changes in its behaviour over its history. Click here to see more. Version | No | Change In Behaviour |
---|
1 | 40 | Extra inputs (100% compatible) |
|