Excel DATEDIF formula to show time gap between two dates
top of page

Excel DATEDIF formula to show time gap between two dates


You can use the DATEDIF formula to calculate the number of years, months, or days between dates entered in two different cells in an Excel spreadsheet.

So, if we use the formula: =DATEDIF(A2,B2,"Y")

. . . it will show the number of years between one date in cell A2 and a later date in B2. The result will only show the full number of years. So in this example:

. . . only three years are shown between November 8, 2016 and November 3, 2020 because it has been five days short of 4 years.

If the letter in parentheses at the end of the formula is changed from a Y to a M, the number of months will be shown.

=DATEDIF(A3,B3,"M")

Changing to a D will result in the number of full days being shown in the designated date range.

=DATEDIF(A4,B4,"D")


Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page