1. Home
  2. Functions
  3. Date and time
  4. YEARFRAC

YEARFRAC function

Returns the fraction of a year between two dates using a day count basis.

Syntax

=YEARFRAC(start_date, end_date, [basis])

Arguments

ArgumentRequiredDescription
start_dateRequiredThe first date
end_dateRequiredThe second date
basisOptional0 US 30/360 (default), 1 actual/actual, 2 actual/360, 3 actual/365, 4 European 30/360

How to use YEARFRAC

YEARFRAC takes 2 required arguments and 1 optional argument. Type =YEARFRAC( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=YEARFRAC(DATE(2012,1,1), DATE(2012,7,30))Result 0.580555556
=YEARFRAC(DATE(2012,1,1), DATE(2012,7,30), 1)Result 0.576502732
=YEARFRAC(DATE(2012,1,1), DATE(2012,7,30), 3)Result 0.578082192

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.