白班中班跨日夜班,用一个Excel公式计算工作时长
时间:2023-09-07 05:38:08
很多单位存在白班中班夜班三班倒的上班制度,这样,统计工作时长,就存在跨日期的情况。
如下样表:
绿色底纹区域就是跨日夜班的上下班情况。
白班、中班,下班时间在当天,工作时长直接用“下班时间—上班时间”就可以了,这种跨日夜班,单用一个时间相减,就解决不了了。
公式实现
在E2单元格输入公式:=D2+(D2<C2)-C2,确定,得第一位员工的工作时长,向下填充,即得所有员工工作时长。
公式解析
公式中的D2<C2是一表达式:
如果D2小于C2,返回值为真,即1;
如果D2不小于C2,返回值为假,即0。
D2小于C2,也就是下班时间小于上班时间,即是跨日夜班,公式“=D2+(D2<C2)-C2”就变成了“=D2+1-C2”。在EXCEL里,天数是整数,时间是小数,时间运算时,1即是1天,也就是24小时,这样,就计算出了跨日夜班的工作时长。
标签:Excel函数,excel函数公式,excel表格制作,Excel教程
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
excel表格中怎么画任意线
2023-09-30 23:47:38
我的世界hmcl启动器怎么使用?我的世界hmcl启动器使用方法
2023-06-30 14:03:23
![](https://img.aspxhome.com/file/2023/7/a328001_0s.jpg)
如何在网易漫画中调节亮度?网易漫画调节亮度的方法
2023-08-02 13:38:20
![](https://img.aspxhome.com/file/2023/8/a332934_0s.jpg)
Excel怎么自定义单元格格式?Excel自定义单元格格式方法
2022-11-30 10:46:11
![](https://img.aspxhome.com/file/2023/30/a266241_0s.gif)
wps中excel数据透明表如何修改行列字段顺序?
2023-11-24 21:31:48
![](https://img.aspxhome.com/file/2023/4/a165474_0s.jpg)
WPS excel如何实现逆向粘贴
2022-09-09 03:09:15
![](https://img.aspxhome.com/file/2023/7/a184977_0s.png)
Windows7系统笔记本电脑屏幕颜色偏白的解决方法
2022-05-08 04:41:54
![](https://img.aspxhome.com/file/2023/29/a252503_0s.png)
Win10电脑鼠标右键一直转圈圈的解决方法
2023-04-18 14:55:11
![](https://img.aspxhome.com/file/2023/1/a278627_0s.png)
Win10网络怎么唤醒?Win10网络唤醒的方法
2023-09-25 19:51:19
![](https://img.aspxhome.com/file/2023/0/47490_0s.png)
Win11 Windows聚焦不更新了怎么解决?聚焦锁屏图片不更换怎么办?
2022-09-08 19:31:33
![](https://img.aspxhome.com/file/2023/27/a235076_0s.jpg)
使用5G网络一定要办5G套餐吗?
2023-02-22 07:00:20
![](https://img.aspxhome.com/file/2023/4/a196174_0s.jpg)
如何提取PPT母版背景图?提取PPT母版背景图教程
2023-02-01 20:28:43
![](https://img.aspxhome.com/file/2023/10/a350371_0s.jpg)
微星笔记本怎么升级Win11 微星笔记本升级Win11详细教程
2023-10-06 07:28:46
![](https://img.aspxhome.com/file/2023/27/a237986_0s.jpg)
Win11系统怎么设置下拉关机?
2022-02-02 01:01:56
![](https://img.aspxhome.com/file/2023/1/a275301_0s.jpg)
页眉下划线如何去掉-word页眉下划线删除方法
2022-08-12 21:34:20
![](https://img.aspxhome.com/file/2023/3/a293961_0s.jpg)
360防蹭网在哪?怎么用360防蹭网?
2022-01-17 16:58:59
![](https://img.aspxhome.com/file/2023/8/a340106_0s.jpg)
sqlyog数据库怎么导入sql文件?
2022-05-14 14:53:07
![](https://img.aspxhome.com/file/2023/5/a313503_0s.png)
Wps如何在表格进行数据对比 Wps进行表格数据对比的方法
2023-04-25 06:43:00
![](https://img.aspxhome.com/file/2023/0/a165460_0s.gif)
wps幻灯片如何设置循环播放功能
2023-07-30 20:40:21
如何给word 2003定制个性工具栏
2023-02-08 06:50:09
![](https://img.aspxhome.com/file/2023/4/33954_0s.jpg)