简体   繁体   English

如何在员工工作时间中添加单位后缀?

[英]How do I add a unit suffix to the hours an employee has worked?

I'm looking for a formula to count hours and set up a shift plan My idea is for managers, front of house and back of house to have their own planner. 我正在寻找一个计算小时数并制定轮班计划的公式,我的想法是让经理,房屋前部和房屋后部都有自己的计划者。 Where I fall at is when I try to count hours for each staff member BUT also make it legible to the reader when printed 当我尝试计算每个工作人员的小时数时,我会跌倒,但是当打印时,也让读者看得清楚

For example Staff member 4 does 0830-1600 with an hour break on Monday 1200-1900 with no break on Tuesday I want it to look like 0830-1600, but in the total hours to count out the whole week from the times put in each day 例如,工作人员4做0830-1600,在星期一1200-1900休息一小时,在星期二不休息,我希望它看起来像0830-1600,但是在总小时数中要计算每个星期的时间天 在此处输入图片说明

I think you need to re-design your calendar. 我认为您需要重新设计日历。 Excel loves raw data to be split out onto separate rows so let's start with that. Excel喜欢将原始数据拆分为单独的行,因此让我们开始吧。

This is my end goal - it's a simplified version of yours 这是我的最终目标-这是您的简化版本 在此处输入图片说明


Data 数据

So let's set out the data that will get us there - in rows . 因此,让我们着手,将让我们在那里的数据 - For this example, paste the data into cell A6 : 对于此示例,将数据粘贴到单元格A6

Name    Day      Time In  Time Out  Total
Name 1  09/01/17    08:00   18:00   10:00
Name 1  12/01/17    11:00   15:00   04:00
Name 1  13/01/17    12:00   21:00   09:00
Name 2  10/01/17    08:00   13:00   05:00
Name 2  11/01/17    12:00   20:00   08:00
Name 2  13/01/17    10:00   14:00   04:00

And then add another few columns onto the end which will be useful in getting totals and making the table more readable 然后在末尾再添加几列,这将有助于获得总计并提高表格的可读性 在此处输入图片说明

Unique ID is created simply by concatenating name and day : =A7&B7 . 通过将名称和日期连接起来即可创建唯一ID=A7&B7 And the Time String uses the TEXT function 时间字符串使用TEXT函数

=UPPER(TEXT(C7,"hAM/PM")&"/"&TEXT(D7,"hAM/PM"))


Table

Create your table in A1:F3 (like below). A1:F3创建表格(如下所示)。 No need for manual shift data but do put your people and dates headings in: 无需手动轮班数据,但可以将您的人员和日期标题放在: 在此处输入图片说明

Use this simple formula in cell B2 and drag down and across to populate shift data 在单元格B2使用此简单公式,向下拖动以填充班次数据

=IFERROR(VLOOKUP($A2&B$1,$F$6:$G$12,2,0),"OFF")

Similarly, you can use this formula for the total hours 同样,您可以使用此公式计算total hours

=SUMIF($A$7:$A$12,$A2,$E$7:$E$12)*24


Result 结果

The final result is below, and can be easily manipulated for more people/ dates, etc. 最终结果如下,可以方便地为更多的人/约会等操作。

在此处输入图片说明

If you have questions about any of these formulas/ techniques -- do ask 如果您对这些公式/技术有疑问-请询问

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

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