ExcelFlux

YEARFRAC function

the year fraction representing the number of whole days between start_date and end_date.

Date and time

Where can you use it?

Planning and operations teams. Use this group to work with dates and times in calendars, delivery schedules, shifts and period reporting.

Scenario in the workbook

Express the actual elapsed days as a fraction of 360. Basis 2 selects Actual/360.

A worked example from the workbook

RowAB
6InputComparison
74602346023
84602346024
94602346059
Record 1
=YEARFRAC(A7,B7,2)

Expected result0

See the inputs and instructions for all 3 examples

Syntax

YEARFRAC(start_date, end_date, [basis])

Copyable formulas

English Excel · en-US
=YEARFRAC(A7,B7,2)
Turkish Excel · tr-TR
=YILORAN(A7;B7;2)

Worked examples

Express the actual elapsed days as a fraction of 360. Basis 2 selects Actual/360.

Open the English sheet. Inputs begin at A6. F7:F9 show the live results and G7:G9 show the original results for comparison.

Row A B
6 Input Comparison
7 46023 46023
8 46023 46024
9 46023 46059
Case Formula Expected result
Record 1 =YEARFRAC(A7,B7,2) 0
Record 2 =YEARFRAC(A8,B8,2) 0.002777777778
Record 3 =YEARFRAC(A9,B9,2) 0.1
Microsoft Excel reference