简体   繁体   English

将文本转换为时间并计算差异Excel

[英]Convert Text to Time and Calculate Difference Excel

I have a text as 00:02:02:22 where the syntax is hh:mm:ss:ff (hours:minutes:seconds:frames) 我的文本为00:02:02:22,其中语法为hh:mm:ss:ff(小时:分钟:秒:帧)

I have tried changing the format to time so that I can calculate the difference between two values but I keep getting #VALUE. 我尝试将格式更改为时间,以便可以计算两个值之间的差,但我一直得到#VALUE。

I would like the answer in decimal places as 2.43 seconds... 我希望答案在小数点后为2.43秒...

The decimal value is frames which divided by 24. So eg 十进制值是除以24的帧。因此,例如

So the difference between 00:02:02:22 and 00:02:05:18 would be 2.83 seconds 因此,00:02:02:22和00:02:05:18之间的时差为2.83秒

There are a number of frame codes: 有许多帧代码:

Film (24 frames per second)
PAL (25 fps)
NTSC (29.97 fps)
NTSC Drop-Frame
Digital Video (30 fps)
50 fps
60 fps

Assuming yours is the first. 假设您是第一个。

With data in A1 like: A1中的数据如下:

11:11:11:10

In another cell enter: 在另一个单元格中输入:

=LEFT(A1,2)/24+MID(A1,4,2)/(24*60)+MID(A1,7,2)/(24*60*60)+RIGHT(A1,2)/(24*60*60*24)

and format this cell as: 并将此单元格的格式设置为:

[ss].00 [ss] .00

在此处输入图片说明

Once the values are converted to true times, values can be subtracted and the differences formatted as you like. 一旦将值转换为真实时间,就可以减去值,并根据需要格式化差异。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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