[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

YEARFRAC

Syntax:

YEARFRAC ( start-date , end-date [ , basis ] )

Description: Computes the fractional number of years represented by the number of whole days between two dates, start-date and end-date., according to basis.

Arguments:

Name

Type

Description

start-date

number

The period's starting date. start-date can be earlier than, the same as, or later than end-date.

end-date

number

The period's ending date.

day-count-basis

number

The security's issue date.

basis

number

The truncated integer type of day count basis to use, as follows:

Value

Day Count Basis

0 or omitted

US (NASD) 30/360

1

Actual/actual

2

Actual/360

3

Actual/365

4

European 30/360

 

 

All arguments are truncated to integers.

Return Type and Value: number – The fractional number of years represented by the number of whole days between two dates, start-date and end-date., according to basis.

However, if the value of basis is out of range, #NUM! is returned.

[Example:

YEARFRAC(DATE(2006,1,1),DATE(2006,3,26)) results in 0.236111111
YEARFRAC(DATE(2006,3,26),DATE(2006,1,1)) results in 0.236111111
YEARFRAC(DATE(2006,1,1),DATE(2006,7,1)) results in 0.5
YEARFRAC(DATE(2006,1,1),DATE(2007,9,1)) results in 1.666666667
YEARFRAC(DATE(2006,1,1),DATE(2006,7,1),0) results in 0.5
YEARFRAC(DATE(2006,1,1),DATE(2006,7,1),1) results in 0.495890411
YEARFRAC(DATE(2006,1,1),DATE(2006,7,1),2) results in 0.502777778
YEARFRAC(DATE(2006,1,1),DATE(2006,7,1),3) results in 0.495890411
YEARFRAC(DATE(2006,1,1),DATE(2006,7,1),4) results in 0.5

end example]