Financial Toolbox    
yearfrac

Fraction of year between dates

Syntax

Arguments

StartDate
Enter as serial date numbers or date strings.
EndDate
Enter as serial date numbers or date strings.
Basis
(Optional) Day-count basis: 0 = actual/actual (default), 1 = 30/360, 2 = actual/360, 3 = actual/365.

Description

Fraction = yearfrac(StartDate, EndDate, Basis) returns a fraction based on the number of days between dates StartDate and EndDate using the given day-count basis. If EndDate is earlier than StartDate, YearFraction is negative.

Examples

See Also

days360, days365, daysact, daysdif, months, wrkdydif, yeardays


  yeardays ylddisc