Help needed

New Contributor

Hi everyone,


I have an attendance file with our employees' schedules and their login and logout record. The problem is, they have multiple logins/logouts. What I want to do is get the first login and the last logout of each employee, and a remark of "tardy" if they log in after their scheduled start time. I also want a remark of "undertime" if they log out too early from their scheduled logout. I want to have this data in a pivot table but I've been having a hard time doing this. If anyone can suggest a formula or what's the best thing to do in this scenario, I'd greatly appreciate it. Kindly note also that there are employees who are scheduled at 12AM and understandably they log in at around 11 PM the previous day, how am I going to include them in the attendance if the file will only capture their login for today (sometimes they log in at 11PM the previous day, then they log in again at 1AM, and as a result, they are marked as tardy).

I've attached a sample file for everyone to check. In the file, I only include 4 employees, but in reality, we have a hundred employees and sometimes more than 1000 login/logout records, and as you may understand it's difficult to check their logins manually so I'd really appreciate it if anyone can help with this.


3 Replies





I can help you on this. I have a question about the Employee C. When you say logout at 12:01AM, it should be the next day. Are you sure about the example given ?



Is the logout 11/01/2021 or 12/01/2021 ?


@SantoshKAMALA hello, thanks so much for the reply.


Sorry about the error, it should be the one below. Basically, Employee C has 2 logins captured, the first is at 11:36 PM of January 10th and the second login is at 1:01 AM of January 11th. His scheduled login is at 12:00 AM of January 11th. How can I compute his login and make sure he is not marked as Tardy? If I run a report for January 11th, it will only capture the 1:01 login as the first login and not the login at 11:36 PM the previous day.





@SantoshKAMALA  And yes, to answer your question - the 12:01 AM logout is for the next day.

So, first login is at 11:36 PM January 10th and logout at 12:01 AM January 11th. They then log back in again at 1:01 AM January 11th and log out at 9:05 AM January 11th.