How to use the YEARFRAC function
Author: Oscar Cronquist Article last updated on May 21, 2022
The YEARFRAC function returns the fraction of the year based on the number of whole days between a start date and an end date.
Use the YEARFRAC function to calculate a part of a whole based on a date range relative to a year.
Formula in cell B8:
=YEARFRAC(C3,C4,C5)
Excel Function Syntax
YEARFRAC(start_date, end_date, [basis])
Arguments
start_date | Required. |
end_date | Required. |
[basis] | Optional. Day count basis.
0 - Default value. US (NASD) 30/360 1 - Actual/actual 2 - Actual/360 3 - Actual/365 4 - European 30/360 |
Comments
Use the DATE function to create a date if you enter the date in the function.
Example:
=YEARFRAC(DATE(2018,1,1),DATE(2018,5,31))
Functions in 'Date and Time' category
The YEARFRAC function function is one of many functions in the 'Date and Time' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form