# YEARFRAC

## Content

This function returns the fraction of the year represented by the number of whole days between the start and end dates.

## Syntax

`YEARFRAC( startdate, enddate, basis )`

## Arguments

This function has these arguments:

| Argument | Description |
| -------- | ----------- |
| *startdate* | Starting date (DateTime object) |
| *enddate* | Ending date (DateTime object) |
| *basis* | [Optional] Integer representing the basis for day count (Refer to [Day Count Basis](/spreadjs/docs/v16/formulareference/formulaoverview/functionsformula/DayCountBasis).) |

## Remarks

This function returns an error when the start, end, or basis is invalid.

## Data Types

Accepts numeric, string, DateTime object data for the date arguments and numeric data for the optional argument. Returns numeric data.

## Examples

`YEARFRAC(A1,A2,A3)`