简体   繁体   English

在excel中查找第一个和最后一个登录名

[英]finding first and last login in excel

在此处输入图片说明

I need to pull the first and last login for each employee for each date listed. 我需要在列出的每个日期中为每位员工拉出第一个和最后一个登录名。 There are about 40 employees and 365 days (give or take). 大约有40名员工,365天(给予或接受)。

This formula works but I would have to enter every employee in cell E2 and every date in F2 in order to get the first and last login times. 该公式有效,但是我必须在E2单元格中输入每个员工,在F2中输入每个日期,才能获得第一次和最后一次登录时间。

Is there any way I can do this in one fell swoop and get all first and last for all dates and all employees? 我有什么办法可以一口气做到这一点,并在所有约会和所有员工中获得所有的第一和最后?

在此处输入图片说明

You do not need any code to achieve this, a basic Pivot Table would solve your problem: 您不需要任何代码即可实现此目的,基本的数据透视表可以解决您的问题:

Being on a cell on your data table, select Insert | 在数据表的某个单元格上,选择“ 插入” |“插入” Pivot Table 数据透视表

Your Pivot data should be automatically selected, and Pivot table should be created as a template. 您的数据透视表数据应自动选择,并且数据透视表应创建为模板。

You may now drag and drop the requested fields from top right to bottom right drawers. 现在,您可以从右上角到右下角抽屉中拖放请求的字段。 In your case Employee and Date fields should go to Rows drawer. 在您的情况下,“雇员”和“日期”字段应转到“ 行”抽屉。

After dragging Time field to Values drawer, you should click on the Time field in the drawer and: 将“时间”字段拖到“ 值”抽屉后,应单击抽屉中的“时间”字段,然后:

  1. Change the Summarize the field by to "Min" 将“ 汇总字段 ”更改为“最小”
  2. And using Number Format button on that screen, change the format to Time. 然后使用该屏幕上的数字格式按钮,将格式更改为时间。

You should now re-drag the Time field to Values and this time summarize the new value as "Max" 现在,您应该将“时间”字段重新拖动到“值”,这次将新值汇总为“最大”

At the end, you should be having a view similar to below: 最后,您应该具有类似于以下的视图: 屏幕截图

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

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