简体   繁体   English

Excel公式,用于计算两个日期列之间的差异

[英]Excel formula for calculating difference between two date columns

I have to 10k rows with two date columns. 我必须有两个日期列的1万行。 Can excel experts please provide an excel formula to calculate time difference(looking for diff in minutes) between below two date columns. Excel专家可以提供一个Excel公式来计算下面两个日期列之间的时差(以分钟为单位)。

I have tried the formula =A1-B1 but its throwing #VALUE! 我尝试过公式= A1-B1,但是它抛出#VALUE!

column A1 = 05/30/2019 21:16:48 +00:00 列A1 = 05/30/2019 21:16:48 +00:00

column B1 = 05/30/2019 21:10:28 +00:00 列B1 = 05/30/2019 21:10:28 +00:00

As mentioned in a comment by @Ron Rosenfeld , your times are just Strings and not true date/time values. @Ron Rosenfeld的评论中所述,您的时间只是字符串,而不是真正的日期/时间值。

If you can't alter the original data (with a find/replace to eliminate all the +00:00 ), then a simple SUBSTITUTE and your original subtraction should work. 如果您不能更改原始数据(通过查找/替换来消除所有+00:00 ),则可以使用简单的SUBSTITUTE和您的原始减法进行工作。 Also, multiply by 1440 to convert the result to minutes: 60 minutes/hour * 24 hours/day = 1440 minutes/day. 另外,乘以1440可将结果转换为分钟:60分钟/小时* 24小时/天= 1440分钟/天。

=(SUBSTITUTE(A1," +00:00","")-SUBSTITUTE(B1," +00:00",""))*1440

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

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