Date Difference

Patnaik14

Member
Hi All,

I have two columns with date value in Excel. How to get only the date difference?
Suppose Column 1 has value: 02.06.2018 & Column 2 has value: 30.05.2018
Then the difference we need = 3

Thanks...
 

sivagelli

Well-Known Member
Hi All,

I have two columns with date value in Excel. How to get only the date difference?
Suppose Column 1 has value: 02.06.2018 & Column 2 has value: 30.05.2018
Then the difference we need = 3

Thanks...
In the Column 3, use the excel formula =DATEDIF (start_date, end_date, unit) this gets you the days difference between the two dates.

In your case in cell reference C1, put the formula =DATEDIF(MIN(A1,B1), MAX(A1,B1),"D")

The reason I used Min() and MAX() is DATEDIF() would return #NUM error if the start date is greater than the end date. If the date in column1 is greater than date in column2, you will end up with an error. So, to avoid error, I framed the formula using Min() and Max().

Refer the web page for additional details related to DATEDIF().

Hope this helps!
 
Top