If you want to calculate the number of days between two Excel dates, this can be done by simply subtracting the earlier date from the later date.
For example, if the start date is stored in cell B1 and the end date is stored in cell B2, the number of days between these two dates is calculated by typing the following into any Excel cell:
This method works because Excel dates are internally stored as simple integers. It is only the formatting of an Excel cell that causes its value to be displayed as a date, rather than as a simple number.
Cell B3 of the following spreadsheet shows a simple Excel date difference calculation. The calculation simply subtracts the date in cell B1 from the date in cell B2.
The above subtraction formula returns the result 62.
The Excel Days Function also calculates the number of days between two supplied dates. However, the function was only introduced in Excel 2013, so is not available in earlier versions of Excel.
The syntax of the Days function is:
Cell B3 of the following spreadsheet shows the Excel Days function, used to calculate the number of days between the two dates in cells B1 and B2:
The above Days function returns the value 62.
Cell B3 of the following spreadsheet shows the Excel Yearfrac function, used to calculate the number of years between the two dates in cells B1 and B2:
The above Yearfrac function returns the value 33.17222222.
I.e. There are 33.17 years between the dates 01/01/1983 and 03/03/2016.