Forum Discussion
Gaedupe
Dec 03, 2021Copper Contributor
How do I use excel to calculate the difference between two dates
Help me with the formula for calculating the difference in minutes between two dates
HansVogelaar
Dec 03, 2021MVP
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.
Gaedupe
Dec 04, 2021Copper Contributor
Please help. I have attached an excel file
- HansVogelaarDec 04, 2021MVP
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.
- GaedupeDec 04, 2021Copper ContributorThe formula you attached is giving me an error. May you kindly attach the excel file you worked on?
- HansVogelaarDec 04, 2021MVP
Here it is (again):