Forum Discussion
Compute elapsed time
I have a spreadsheet of charging time for my Jeep. I would like to calculate the duration of the charging period but am having problems coming up with a formula that would work. It would have to account for the minutes where the start time minute is greater than the end time minute. Unless someone has another way of computing this.
Ah you have Excel 2013. That doesn't have access to these newer functions.
By Date-Time combined format I just mean put the whole date AND time into a single cell:
Start End Total
6/26/2026 16:03 6/27/2026 04:06 =B5-A5
the alternative using your current format might be something like:
G5 = HOUR ( D5+TIME(E5,F5,0) - A5 - TIME(B5,C5,0) )
H5 = MINUTE ( D5+TIME(E5,F5,0) - A5 - TIME(B5,C5,0) )
5 Replies
- JAV6Tin Contributor
m_tarler​ Thanks! Works fine.
- JAV6Tin Contributor
Doesn't work for me in my version of Excel.
How are you 'combining' the individual cells?
- m_tarlerSilver Contributor
Ah you have Excel 2013. That doesn't have access to these newer functions.
By Date-Time combined format I just mean put the whole date AND time into a single cell:
Start End Total
6/26/2026 16:03 6/27/2026 04:06 =B5-A5
the alternative using your current format might be something like:
G5 = HOUR ( D5+TIME(E5,F5,0) - A5 - TIME(B5,C5,0) )
H5 = MINUTE ( D5+TIME(E5,F5,0) - A5 - TIME(B5,C5,0) )
- JAV6Tin Contributor
Can you show me the simple Date-Time combined format solution?
- m_tarlerSilver Contributor
If you enter the data as Date-Time combined format then a simple difference will work.
Here I basically combine the individual cells and then use HSTACK to then break Hour and Min up:
=LET(t,D5+TIME(E5,F5,0)-A5-TIME(B5,C5,0),HSTACK(HOUR(t),MINUTE(t)))
but each of those could be arrays too so all the results could be:
=LET(t,D5:D6+TIME(E5:E6,F5:F6,0)-A5:A6-TIME(B5:B6,C5:C6,0),HSTACK(HOUR(t),MINUTE(t)))
or more generally:
=LET(t,D5:.D99+TIME(E5:.E99,F5:.F99,0)-A5:.A99-TIME(B5:.B99,C5:.C99,0),HSTACK(HOUR(t),MINUTE(t)))