简体   繁体   English

计算时间差和总持续时间

[英]Calculate time differences and sum duration

I am trying to create a small "app" using tasker on my android phone that am supposed to track my workhours and over/under-time.我正在尝试在我的 android 手机上使用 tasker 创建一个小的“应用程序”,它应该跟踪我的工作时间和超时/超时。 I have managed to get tasker to send timestamps on the start/end of each workday and are writing them to a google sheet so it gets recorded like:我设法让 tasker 在每个工作日的开始/结束时发送时间戳,并将它们写入谷歌表,以便记录如下:

                                     <Not implemented>        <Not implemented>  
 |     A      |       B     |    C     |     D     |    E       |    F    |
 | 2020-01-29 |     07:24   |   16:33  |    00:09  |            | -02:51  | 
 | 2020-01-30 |     07:00   |   12:00  |   -03:00  |            |         |

Where the "D" column is the difference between ordinary workhours (8) and actually registred hours.其中“D”列是普通工时 (8) 与实际登记工时之间的差值。

The "F" column should summarize the "D" column and show the sum of all values. “F”列应汇总“D”列并显示所有值的总和。 The data in the three first columns are beeing sent correctly but I cant figure out how to set up formulas so that the values for the "D" column is added and and same thing with the cell in the "F" column.前三列中的数据正确发送,但我无法弄清楚如何设置公式,以便添加“D”列的值,并且与“F”列中的单元格相同。 I have been trying to change to different formats and tried creating my own formats to but do not understand how to get it to work.我一直在尝试更改为不同的格式并尝试创建自己的格式,但不知道如何使其工作。

I'm getting a different result than you in D1.我在 D1 中得到的结果与你不同。 I wonder if you're also accounting for a lunch hour (so subtract 9 instead of 8), but these formulas worked for me:我想知道您是否也在考虑午餐时间(因此减去 9 而不是 8),但这些公式对我有用:

  • in Column D: =(C1-B1)-(8/24)在 D 栏中: =(C1-B1)-(8/24)
  • in Cell F1: =sum(D1:D2)在单元格 F1 中: =sum(D1:D2)

Column D and Cell F1 are formatted as Time > Duration.列 D 和单元格 F1 的格式为时间 > 持续时间。

Here's the result:结果如下: 谷歌表格试运行

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

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