All functions / Date & Time
YEARFRAC
The fraction of a year between two dates, using a day-count basis.
Syntax
=YEARFRAC(start_date, end_date, [basis])
Arguments
start_date: The first date.end_date: The second date.basis(optional): 0 (default): US 30/360. 1: actual/actual. 2: actual/360. 3: actual/365. 4: European 30/360.
Example
=YEARFRAC(DATE(2024,1,1), DATE(2024,7,1)) → 0.5