The DATEDIF function is a built-in function in Microsoft Excel that calculates the difference between two dates in a variety of different units, such as days, months, or years.
The syntax for the DATEDIF function is as follows:
=DATEDIF(start_date,end_date,unit)