YEARFRAC Function
The YEARFRAC
function in Google Sheets calculates the fraction of the year represented by the number of whole days between two dates.
Syntax
YEARFRAC(start_date, end_date, [day_count_convention])
start_date
: The start date of the period.end_date
: The end date of the period.day_count_convention
(optional): The type of day counting to use.
Examples
- Basic Usage
To find the fraction of the year between "2024-01-01"
and "2024-08-15"
:
=YEARFRAC("2024-01-01", "2024-08-15")
- Using a Specific Day Count Convention
Using a 30/360 day count convention:
=YEARFRAC("2024-01-01", "2024-08-15", 0)
Notes
- The
day_count_convention
determines how days are counted and affects the result. - Useful for financial calculations, like interest over a period.