# Excel DATEDIF Function | Excel One Minute Quick Reference

Posted on:  10/07/2021

Need to know the number of years, months, or days between two dates? Excel's DATEDIF function will calculate it for you. This is a great function if you work in Human Resources (HR), or any job position where you need the difference in dates. I also use the TODAY function - which I recently covered in two videos and mixed and absolute reference.

## Syntax for DATEDIF

=DATEDIF(start_date,end_date,unit)

## Units in DATEDIF

 UNIT Description Y The number of complete years in the period. M The number of complete months in the period. D The number of days in the period. MD The difference between the days in start_date and end_date. The months and years of the dates are ignored. YM The difference between the months in start_date and end_date. The days and years of the dates are ignored.

## Other Excel Articles

#### Copilot for Excel - Is it Accurate? 11 Tests Performed

##### Chris Menard

Chris Menard is a certified Microsoft Trainer (MCT) and works as a full-time Trainer at BakerHostetler - one of the largest law firms in the US. He runs a YouTube channel with 900+ technology videos that cover various tools such as Excel, Word, Zoom, Teams, Gmail, Google Calendar, and Outlook. To date, the channel has helped over 20 million viewers. Menard also does 2 to 3 public speaking events every year, presenting at the Administrative Professional Conference (APC), the EA Ignite Conference, the Support Staff Conference, the University of Georgia, and CPA conferences. You can connect with him on LinkedIn at https://chrismenardtraining.com/linkedin or watch his videos on YouTube at https://chrismenardtraining.com/youtube.