根据Google表格中的时间表数据计算工作时间和员工的休息时间

有两个Google表格 时间表(数据来自RFID阅读器) https://docs.google.com/spreadsheets/d/1T_ZbPub9CV_-S5Ve5OxtlPoGfvV8uXkxxoKnUGBuXPo/edit?usp=sharing 希望有一个雇员的工作时间,并在一个月内休息。 (员工一天可以休息几次) 对于给定的一天,总是第一个拳头是IN,第二个拳头是OUT,这将给出他工作的时间。剩下的就是休息时间

结果表(每月出勤) https://docs.google.com/spreadsheets/d/1IWu1eJCtG3LQQYfF2N5Hd02rZ2t3GfgbjOoYQbQuQFk/edit?usp=sharing

由于数据是一列,所以对于给定的一天,如何实现迭代。

根据Google表格中的时间表数据计算工作时间和员工的休息时间

根据Google表格中的时间表数据计算工作时间和员工的休息时间

kingking007007 回答:根据Google表格中的时间表数据计算工作时间和员工的休息时间

首先,您需要做一些准备工作。参见 J:O

0

然后您可以执行简单的HLOOKUP

=ARRAYFORMULA(IFERROR(HLOOKUP(A24:24,QUERY(QUERY({Sheet2!J1:O},"select Col1,day(Col1),sum(Col5),sum(Col6),Col4 
  where month(Col1)+1="&B23&" 
  group by Col1,Col4 
  format Col1'd'",0),"select Col5,"&IF(D23="Break","sum(Col4)","sum(Col3)")&" 
  where Col5 is not null
  group by Col5
  pivot Col2
  label Col5'Employee names'",1),ROW(A2:A20),0)))

0

spreadsheet demo


更新:

要解决缺失的打孔问题,您可以添加支票:

={"punch-out check"; 
 ARRAYFORMULA(IFNA(VLOOKUP(A2:A&C2:C,QUERY(QUERY({A2:A&C2:C,COUNTIFS(A2:A&C2:C,A2:A&C2:C,ROW(A2:A),"<="&ROW(A2:A))},sum(Col2) group by Col1"),"where not Col2 >1 offset 1",2,0)))}

1


那么公式将是:

=ARRAYFORMULA({"Date","Start","End","Name";
 {ARRAY_CONSTRAIN(FILTER(SORT(FILTER({timesheet!A2:B,timesheet!E2:E},timesheet!F2:F<>1),1,3,MOD(ROW(INDIRECT("timesheet!A1:A"&ROWS(timesheet!A2:A)-COUNTIF(timesheet!F2:F,1))),2)),ROWS(timesheet!A2:A)-COUNTIF(timesheet!F2:F,2)},QUERY(FILTER(SORT(FILTER({timesheet!A2:B,MOD(ROW(INDIRECT("timesheet!A2:A"&ROWS(timesheet!A2:A)-COUNTIF(timesheet!F2:F,1)+1)),"select Col2,Col3",0)})

9


并且仪表板将其列出为:

={"Didn't punched out"; FILTER(timesheet!E2:E,timesheet!A2:A=C2,timesheet!F2:F=1)}

9

,

我认为您可以做到

Sum of even times - Sum of odd times

=ArrayFormula(sumif(iferror(iseven(rank(if((timesheet!$E2:$E=$A3)*(timesheet!$A2:$A=date(2019,$B$1,O$2)),timesheet!$B2:$B),if((timesheet!$E2:$E=$A3)*(timesheet!$A2:$A=date(2019,1)),false),true,timesheet!$B2:$B)-
sumif(iferror(isodd(rank(if((timesheet!$E2:$E=$A3)*(timesheet!$A2:$A=date(2019,timesheet!$B2:$B))

这是整张纸上的样子:

enter image description here

编辑

检查一下打孔次数是否是偶数:

=ArrayFormula(if(isodd(countifs(timesheet!$E$2:$E,$A3,timesheet!$A$2:$A,date(2019,O$2))),"Error",sumif(iferror(iseven(rank(if((timesheet!$E$2:$E=$A3)*(timesheet!$A$2:$A=date(2019,timesheet!$B$2:$B),if((timesheet!$E$2:$E=$A3)*(timesheet!$A$2:$A=date(2019,timesheet!$B$2:$B)-
sumif(iferror(isodd(rank(if((timesheet!$E$2:$E=$A3)*(timesheet!$A$2:$A=date(2019,timesheet!$B$2:$B)))

enter image description here

本文链接:https://www.f2er.com/3014715.html

大家都在问