简体   繁体   中英

calculate time difference in milliseconds excel

How do i calculate time difference in milliseconds between two columns where value of time has milliseconds component ... ie 16:33:44:056. Please refer to column E and J in pic .. i want to calculate difference in milli seconds between J and E ... 在此处输入图片说明

I have tried using the following formula to alculate difference in milli seconds but its giving incorrect results. =((RIGHT(J1,3))-(RIGHT(E1,3)))

If you change the format of your time columns, and the column to show the difference, to

hh:mm:ss.000

You can simply use subtraction:

在此处输入图片说明

(You'll have to tweak the actual cells to have . before the milliseconds, just formatting won't do it)

It appears your date/time is a text value.

A "real" time value would normally be seen as 16:11:52.052

But by replacing the last : with a . , excel will see it as a real time and ordinary math can be done.

Excel stores date/time as days and fractions of a day.

So a formula that should work:

=ROUND((SUBSTITUTE(J1,":",".",3)-SUBSTITUTE(E1,":",".",3))*86400000,0)

Format the result as General or as Number with no decimal places

Try

=(J1-E1)*1000*60*60*24

or more concisely

=(J1-E1)*86400000

Then format your formula column to general.

This assumes the data is actually stored as datetime and not a text value.

如果该字符串中与小时,分钟和秒相对应的部分始终相同,并且J中的时间始终大于E中的时间,则可以执行以下操作:

=VALUE(RIGHT(J1;3))-VALUE(RIGHT(E1;3))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM