Need to *remove* milliseconds from timestamp

DEMDEJ

New Member
Joined
Jul 8, 2020
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Hi all! I'm trying to remove milliseconds from timestamps. I have two columns from 2 different tables where Column 1 does not have milliseconds and Column 2 does. I don't want the milliseconds in Column 2 to round any of the data so I need to remove the milliseconds altogether and still be able to perform basic calculations with Col2 (Subtraction and Average).

Here is what I have:

Col1 Col2 Difference (Col2 - Col1)
05:07:34 05:08:39.670 00:01:05.670

What I want:
Col1 Col2 Difference (Col2 - Col1)
05:07:34 05:08:39 00:01:05

What I don't want:
Col1 Col2 Difference (Col2 - Col1)
05:07:34 05:08:40 00:01:06


Just changing the format doesn't work because the number is stored with milliseconds.
I've tried a text formula: = (TEXT(B2,"hh:mm")&LEFT(TEXT(B2,":ss.000"),3)) with a help column VALUE(B2), but my Difference column shows an error.
I've tried INT formula, but that removes my seconds =INT(B2*1440)/(1440)
I've tried using LEFT formulas, but I think it's still text that way. I can't format it either way.
Lastly, I tried =TIME(HOUR(B2),MINUTE(B2),SECOND(B2)), but the seconds are rounded by the milliseconds.

I still need to be able to subtract and average Column 2. Any formulas are welcomed. I prefer not to use macros for such a seemingly small task. I refuse to say how long I spent on this, but trust me, ANY help would be greatly appreciated! Help !
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi, you can also write the function like this, which might help make the intention clearer.

Excel Formula:
 =FLOOR(B1,"00:00:01")
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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