Hosted by Dailymotion. For legal issues report at the Copyright Center, report us on DMC, or use the Instant Removal tool.
Why not to use DATEDIF() - Excel Tips and Tricks
18 Views • Jul 02, 2025
Description
These are the available units in DATEDIFF() function.
"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.
Important: We don't recommend using the "MD" argument, as there are known limitations with it. See the known issues section below.
"YM" The difference between the months in start_date and end_date. The days and years of the dates are ignored
"YD" The difference between the days of start_date and end_date. The years of the dates are ignored.
* IMPORTANT *
For "MD" Microsoft does not recommend using the "MD" argument, as there are known limitations with it. See the known issues section below.
These are the formulas used on the video.
Number of complete years in the period
=DATEDIF($A$2,$B$2,A5)
OR
=DATEDIF($A$2,$B$2,"Y")
Number of complete months in the period
=DATEDIF($A$2,$B$2,A6)
OR
=DATEDIF($A$2,$B$2,"M")
Number of days in the period.
=DATEDIF($A$2,$B$2,A7)
OR
=DATEDIF($A$2,$B$2,"D")
Difference between the days in start & end date.
Months & years of the dates are ignored.
=DATEDIF($A$2,$B$2,A8)
OR
=DATEDIF($A$2,$B$2,"MD")
Difference between the months in start & end date.
Days & years of the dates are ignored.
=DATEDIF($A$2,$B$2,A9)
OR
=DATEDIF($A$2,$B$2,"YM")
Difference between the days of start & end date.
Years of the dates are ignored.
=DATEDIF($A$2,$B$2,A10)
OR
=DATEDIF($A$2,$B$2,"YD")
DATEDIF function (Microsoft 365 support)
https://support.microsoft.com/en-us/office/datedif-function-25dba1a4-2812-480b-84dd-8b32a451b35c
excel datedif missing,excel datedif not working,excel datedif today,datedif formula,how to use datedif in excel,
excel datedif minutes,excel datedif alternative,
More from User
I Created a UNIQUE() Function For Excel 2016 and Older Versions - Excel Tips and Tricks
ExcelTips247
Compare Two Tables In Excel - Excel Tips and Tricks
ExcelTips247
TOCOL and TOROW Functions in Excel - Excel Tips and Tricks
ExcelTips247
I Created a XLOOKUP() Function For Excel 2016 and Older Versions - Excel Tips and Tricks
ExcelTips247
Why Use VLOOKUP() with MATCH() in Excel - Excel Tips and Tricks
ExcelTips247
Paste a Linked Picture in Excel - Excel Tips and Tricks
ExcelTips247
Related Videos
Why Fill Handle Excel not working? AutoFill Won't Work as Expected in Excel - Excel Tips and Tricks
ExcelTips247
Why is my flash fill not working in #excel - Excel Tips and Tricks
ExcelTips247
Why do my percentages not add up to 100 Excel? - Excel Tips and Tricks
ExcelTips247
YEARFRAC() vs DATEDIF() in Excel - Excel Tips and Tricks
ExcelTips247
How to Use Flash Fill in Excel for Full Names | Quick Excel Tips & Tricks
Mr. EXCEL HACKS
Compare two lists to find missing values using VLOOKUP in Excel - Excel Tips and Tricks
ExcelTips247