YEARFRAC Calculates the fraction of the year represented by the number of whole days between two dates. Use the YEARFRAC worksheet function to identify the proportion of a whole year’s benefits or obligations to assign to a specific term.


YEARFRAC(start_date, end_date, basis)


start_date – The start date in datetime format.

end_date – The end date in datetime format.

basis – (Optional) The type of day count basis to use. All arguments are truncated to integers.

Basis – Description

0 – US (NASD) 30/360

1 – Actual/actual

2 – Actual/360

3 – Actual/365

4 – European 30/360

Return Value

A decimal number. The internal data type is a signed IEEE 64-bit (8-byte) double-precision floating-point number.

Reference Data

DAX Functions / Date and Time Functions / YEARFRAC