Excel DATEDIF Formula

To find the difference between the two dates in Excel, the important thing is to provide the start and end dates to the DATEDIF function. This can be done in multiple ways as follows:

Cell References

This is the easiest way to make a DATEDIF formula in Excel is to input two valid dates in separate cells and refer to those cells. For example, the following formula counts the number of days between the dates in cells A1 and B1:

=DATEDIF(A1, B1, "d")

Text strings

Excel takes dates as a string for example “1-Jan-2023”, “1/1/2023”, “January 1, 2023”, etc. The dates as text strings enclosed in quotation marks can be typed directly in a formula’s arguments. For instance, this is how you can calculateinto the number of months between the specified dates:

=DATEDIF("1/1/2023", "12/31/2025", "m")

Serial numbers

Microsoft Excel stores each date as a serial number beginning with January 1, 1900, you use numbers corresponding to the dates. But this method is not reliable because date numbering varies on different computer systems. In the 1900 date system, you can use the below formula to find the number of years between two dates, 1-Jan-2023 and 31-Dec-2025:

=DATEDIF(44927, 46022, "y")

Results of other functions

To find out how many days there are between today and 20 May 2025, this is the formula to use.

=DATEDIF(TODAY(), "5/20/2025", "d")

Excel DATEDIF Function

The DATEDIF is a date function that is generally used to find the number of total days, months, and years between two dates. It takes two dates as an argument with one keyword to specify which type of difference is required as an output. The output of the function will always be an integer form. 

Similar Reads

DatedIF Function in Excel

The DATEDIF date function is used to find the difference between two dates(age in simple language). These differences can be in any form years, months, or days. It takes two dates as input with one keyword, where the one is the Start_date and the Second is the End_date, and the keyword is used to determine which type of difference is desired for the output....

Excel DATEDIF Formula

To find the difference between the two dates in Excel, the important thing is to provide the start and end dates to the DATEDIF function. This can be done in multiple ways as follows:...

How to Use DATEDIF Function in Excel

There are three formulas to calculate year, month, and days:...

Frequently Asked Questions

What is the DATEDIF function in Excel? DATEDIF is the Built- in date function which is used to calculate the the difference between two given dates in days, months and years. It takes two dates with one keyword as an argument....