The image above demonstrates the DATEDIF function calculating the number of complete years between two dates. Column B and column C contains random dates.
Formula in cell D3:
Copy cell D3 and paste to cells below. The DATEDIF function requires the start date to be less than (earlier than) the end date, the function returns #NUM if not. It is the third argument that determines which unit to use. "Y" is the abbreviation for the year unit.
Note that the DATEDIF function does not appear when you start typing the function, however, it is there don't worry. The same thing happens when you start typing the arguments, you get no guidance from Excel.
Why can't I divide the number of days between dates with 365? Some years are leap years and those years have 366 days.