如何将MM:SS的持续时间转换为Google表中的几秒钟?

发布于 2025-02-12 12:30:34 字数 267 浏览 1 评论 0原文

作为任务的持续时间,假设我们有一个格式为mm:ss的列,该列需要转换为秒。从数学上讲,解决方案很简单。我们只需要计算mm * 60 + ss将其转换为秒即可。此外,我们遵循 this 解决问题的策略。但是,解决的直接方法仍然是一个问题。

直接做的方法是什么?

As duration of a task, suppose that we have a column with cells formatted as MM:SS that would like to convert to seconds. Mathematically speaking, the solution is simple. We just need to compute MM * 60 + SS converting it to seconds. Additionally, we followed this strategy to solve the problem. However, the direct way to solve it remains a question.

What is the direct way to do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

爱*していゐ 2025-02-19 12:30:36

我按时间函数使用部门。要获取秒数,您只需将持续时间除以时间(0,0,1)即可。

这是我如何使用time()

D,E和F列来自我为员工使用的Google表格。我通过减去开始时间和结束时间来计算G,然后减去午餐时间。这是我第一次使用时间函数。 G的数据格式为持续时间

G2 =(E2-D2)-TIME(0,F2,0)

在此示例中,H列是一个简单的数字。每个人都得到公平的报酬;没有人每小时工作$ 10。实际上,此列从另一张纸上拉出。最后,我是每小时工作时间的时间。

I2 =G2*(H2/TIME(1,0,0))

使用time()函数对我真的很有帮助。

I use division by the TIME function. To get the number of seconds, you can simply divide your duration by TIME(0,0,1).

Here is an example of how I use TIME():
worksheet

Columns D, E, and F come from a Google Form I use for my employees. I calculate G by subtracting the beginning and end times and then subtracting the lunch minutes. This is my first use of the TIME function. The data format for G is Duration.

G2 =(E2-D2)-TIME(0,F2,0)

The H column is an easy number in this example. Everyone is paid fairly; no one works for $10/hour. In reality, this column pulls from another sheet. Lastly, I is the number of hours worked times dollars per hour.

I2 =G2*(H2/TIME(1,0,0))

Using the TIME() function is really helpful for me.

早茶月光 2025-02-19 12:30:36

如果有人想要一个更直观的答案,请将其放在这里。

=MINUTE(A1) * 60 + SECOND(A1)

这抓住了分钟列和第二列,并将分钟列乘以六十。如果需要,这也可以使用数小时,系数为60*60或3600。

=HOUR(A1) * 3600 + MINUTE(A1) * 60 + SECOND(A1)

希望这很有帮助!

Putting this on here if anyone wants a more intuitive answer.

=MINUTE(A1) * 60 + SECOND(A1)

This grabs the minute column and the second column and multiplies the minute column by sixty. This could also be done for hours if desired, and the coefficient would be 60*60, or 3600.

=HOUR(A1) * 3600 + MINUTE(A1) * 60 + SECOND(A1)

Hope this is helpful!

情绪 2025-02-19 12:30:36

使用:

=INDEX(QUERY(SPLIT(TO_TEXT(A1:A), ":")*{60, 1},
 "select Col1+Col2 label Col1+Col2''"))

use:

=INDEX(QUERY(SPLIT(TO_TEXT(A1:A), ":")*{60, 1},
 "select Col1+Col2 label Col1+Col2''"))

enter image description here

你列表最软的妹 2025-02-19 12:30:35

所有值都存储为天数。 1是一天。因此,获得秒数的直接方法是每天乘以24小时,60分钟/小时60秒/分钟。例如,持续1分钟:

="0:1:0"*24*60*60

基础格式始终为hh:mm:ss。对于mm:SS,将因子减少60:

="01:01"*24*60

注意:这有效,因为几分钟内的1小时等于1分钟。但是01:01默认情况下,由Google考虑1小时1分钟。

All values are stored as days. 1 is one day. So the direct way to get seconds is just multiply by 24 hours/day, 60 minutes/hour and 60 seconds/minute. For eg, for 1 minute:

="0:1:0"*24*60*60

The underlying format is always HH:MM:SS. For MM:SS, reduce the factor by 60:

="01:01"*24*60

Note: This works because 1 hour in minutes is equal to 1 minute in seconds. But 01:01 by default, is considered 1 hour and 1 minutes by Google.

与往事干杯 2025-02-19 12:30:35

您有小时:分钟,想将其转换为总数几秒钟?

答案是将时间值(一整天增量)乘以24(每天),然后又增加60(每小时分钟),最后60(每分钟每分钟)。这是假设时间以Excel时间格式存储(我将时间格式与对话框中的37小时示例一起使用,然后从自定义字符串中删除秒)。

示例

You have hours:minutes and want to convert it to just be total seconds?

The answer is to multiply the time value (which is whole day increments) by 24 (hours per day), then by 60 (minutes per hour) and finally 60 again (seconds per minute). This assumes the times are stored in Excel time formatting (I use the time format with the 37 hours example in the dialog box, then removed the seconds from the custom string).

Example

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文