# YEARFRAC function

Calculates the fraction of a year represented by the number of whole days from start_date to end_date. Use the YEARFRAC function to identify the proportion of a whole year's benefits or obligations to assign to a specific term.

## Syntax

YEARFRAC(start_date,end_date,basis)

Important

Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use =DATE(2008,5,23) for the 23rd day of May, 2008. Problems might occur if dates are entered as text.

Argument

Description

Remarks

start_date

A date that represents the first, or starting, date of the period.

• If a valid date is not entered for this argument, this function returns the #VALUE! error value.

• If this argument contains a decimal value, this function ignores the numbers to the right side of the decimal point.

end_date

A date that represents the last, or ending, date of the period.

• If a valid date is not entered for this argument, this function returns the #VALUE! error value.

• If this argument contains a decimal value, this function ignores the numbers to the right side of the decimal point.

basis

The kind of day count basis to use.

• 0 or omitted = US (NASD) 30/360

1 = Actual/actual

2 = Actual/360

3 = Actual/365

4 = European 30/360

• If basis < 0 or if basis > 4, this function returns the #NUM! error value.

• If this argument contains a decimal value, this function ignores the numbers to the right side of the decimal point.

## General remarks

Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

## Example

To make the following example easier to understand, you can copy the data to a blank sheet and then enter the function underneath the data. Do not select the row or column headings (1, 2, 3... A, B, C...) when you copy the sample data to a blank sheet.

 1 2 3 4
 A B Date Description 1/1/2007 Start date 7/30/2007 End date 2 Actual/360 day count basis Formula Description (Result) =YEARFRAC(A2,A3,A4) Fraction of a year from start date to end date (0.583333333)
 Rate this content: