SheetRocks
Documentation/Formulas/YEARFRAC

YEARFRAC

Calculates the fraction of the year represented by the number of whole days between two dates

Syntax

YEARFRAC(start_date, end_date, [basis])

Arguments

Argument Description Required
start_date A date that represents the start date Required
end_date A date that represents the end date Required
basis The type of day count basis to use. Defaults to 0. Optional

Examples

Calculate fraction of year between dates

=YEARFRAC(A1, A2)
Result ⇒ 0.4972
A
1 1/1/2024
2 6/30/2024

Age calculation in years

=YEARFRAC(A1, A2)
Result ⇒ 34
A
1 1/15/1990
2 1/15/2024

Interest calculation period

=YEARFRAC(A1, A2, 1)
Result ⇒ 0.5
A
1 3/1/2024
2 8/31/2024

Related Functions

Other Date/Time functions:


← Back to Formula Reference