Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions > Date and Time > YEARFRAC

 

YEARFRAC(start_date, end_date [,basis])

 
 Returns the number of years as a decimal between two dates.

 start_dateThe starting date.
 end_dateThe finishing date.
 basisThe type of day counting to use.
0 = US 30/360
1 = Actual/Actual
2 = Actual/360
3 = Actual/365
4 = European 30/360

 REMARKS
 
  • This function is only available if you have the Analysis ToolPak add-in installed.
     
  • All arguments are truncated to integers.
     
  • Dates may be entered as text strings within quotation marks, as serial numbers or as results of other formulas or functions.
     
  • If "start_date" or "end_date" are not valid dates, then #NUM! is returned.
     
  • If "start_date" can be a text string or a date serial number.
     
  • If "basis" < 0, then #NUM! is returned.
     
  • If "basis" > 4, then #NUM! is returned.
     
  • If "basis" is left blank, then 0 is used.

     EXAMPLES
     
     A
    1=YEARFRAC("2001/01/25","2001/09/27") = 0.672
    2=YEARFRAC("1/1/1998","6/30/1998",2) = #VALUE!
    3=YEARFRAC("1/1/1998","6/30/1998",0) = #VALUE!
     

     Functions - Y | Index - Y | Dates & Times | Office Online 

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.Top