Formula calculating time between 2 date/times

rawr19911

Board Regular
Joined
Jan 21, 2020
Messages
91
Office Version
  1. 2016
I am having a bit of issue calculating time between 2 dates.
hoping to do this in formula as the sheet is pretty long
here is an example
1713288578497.png
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
You're having problems because those date/times aren't in a format that Excel recognizes as such.

Does this work for you?
=SUBSTITUTE(REPLACE(B2,LEN(B2)-1,0," ")," ",", ",2)-SUBSTITUTE(REPLACE(A2,LEN(A2)-1,0," ")," ",", ",2)
 
Upvote 0
You're having problems because those date/times aren't in a format that Excel recognizes as such.

Does this work for you?
=SUBSTITUTE(REPLACE(B2,LEN(B2)-1,0," ")," ",", ",2)-SUBSTITUTE(REPLACE(A2,LEN(A2)-1,0," ")," ",", ",2)
got a #value error-
this is what i used
=SUBSTITUTE(REPLACE(L2,LEN(L2)-1,0," ")," ",", ",2)-SUBSTITUTE(REPLACE(J2,LEN(J2)-1,0," ")," ",", ",2)
i had to replace the a's ieth j's and the b's with L's

but it gives error back
 
Upvote 0
What's the error because it works for me:

Book1
JKLM
2Oct 1 2023 3:44AMOct 2 2023 1:44AM0.916667
Sheet1
Cell Formulas
RangeFormula
M2M2=SUBSTITUTE(REPLACE(L2,LEN(L2)-1,0," ")," ",", ",2)-SUBSTITUTE(REPLACE(J2,LEN(J2)-1,0," ")," ",", ",2)
 
Upvote 0
Solution
@Scott Huish i also have a quick question while you are helpign me with this- is there anywhere we can just donate money to the site or to the moderators ?
 
Upvote 0

Forum statistics

Threads
1,223,881
Messages
6,175,159
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top