How To Use Yearfrac Excel
Yearfrac 01 jan 19 15 sep 19 returns 0 71.
How to use yearfrac excel. Yearfrac start date end date basis. Now copy the formula to other cells using the ctrl d shortcut key. Yearfrac start date end date basis the yearfrac function syntax has the following arguments. Yearfrac 1 jan 2018 1 jan 2019 returns 1 yearfrac 1 jan 2018 1 jul 2019 returns 1 5. End date the end date.
But the difference is actually more than 1 year so to get the full difference of a year we will use the yearfrac function in the c2 cell. Use the cell reference or date function in excel while taking date as input to the function now press enter to get the yearfrac value the result specifies the year gap between the two dates. Yearfrac calculates a decimal number representing the fraction of a year between two dates. A date that represents the end date. Start date is the first argument so select date 1 as the cell reference i e a2 cell.
Basic syntax of yearfrac function. Basis optional the type of day count basis to use see image below. Start date the start date. Yearfrac start date end date basis arguments. For example given the 01 jan 19 as the start date and the 15 sep 19 as the end date you can calculate the fractional years between these dates using the following formula.
The excel yearfrac function returns a decimal number representing the fractional years between two given dates. Excel uses whole days between two dates to work out the fraction of a year as a decimal value. For instance you can use yearfrac to identify the proportion of a whole year s benefits or obligations to assign to a specific term. All arguments will be truncated to integer. When using the us nasd 30 360 basis and the start date is the last day in february the yearfrac function may return an incorrect result.
The yearfrac function in excel returns a decimal value that represents fractional years between two specified dates. Yearfrac start date end date basis start date is the first variable date end date is the second variable date and basis is the assumption under which excel should return the result of the calculation. The basic formula for using this function is. The yearfrac function however requires a bit more knowledge than most other functions.