YEARFRAC Function in Google Sheets

Calculate the fraction of the year between two dates using the YEARFRAC function.

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

  1. Basic Usage

To find the fraction of the year between "2024-01-01" and "2024-08-15":

=YEARFRAC("2024-01-01", "2024-08-15")
  1. 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.
  • DATEDIF: Calculates the difference between two dates in days, months, or years.
  • EDATE: Returns a date a specified number of months before or after a given date.