How do I use excel to calculate the difference between two dates

Copper Contributor
Help me with the formula for calculating the difference in minutes between two dates
8 Replies

You can use the DATEDIF function.  If your dates are entered in cells A3 and A5 you can use the formula DATEDIF(A3,A5).  

@Gaedupe 

Let's say you have dates in A1 and B1.

In C1, enter the formula

 

=1440*(B1-A1)

 

and format C1 as General (or as Number)

Explanation: Excel stores dates and times as numbers, with 1 day as unit. 1 day = 24*60 minutes = 1440 minutes.

@rreiser68 

=DATEDIF(A3,A5,"D") is more complex equivalent of =INT(A5)-INT(A3) if we speak about datetime, and returns difference in days, not in minutes as it was asked.

Please help. I have attached an excel file

@Gaedupe 

The values in C2 and D2 are not seen as dates by Excel, but as text values.

You can convert them to real dates and calculate the minutes using the formula

 

=1440*((DATE(MID(D2,7,4),MID(D2,4,2),LEFT(D2,2))+TIMEVALUE(RIGHT(D2,8)))-(DATE(MID(C2,7,4),MID(C2,4,2),LEFT(C2,2))+TIMEVALUE(RIGHT(C2,8))))

 

See the attached version.

The formula you attached is giving me an error. May you kindly attach the excel file you worked on?

@Gaedupe 

Here it is (again):