ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sum Times based on StatusID & EmpID (https://www.excelbanter.com/excel-programming/388994-sum-times-based-statusid-empid.html)

noname

Sum Times based on StatusID & EmpID
 
Hi,

I have a columns for EmpID, StatusID(1 for Login, 2 for Logout) &
Times(DateTime Stamp).

EmpID StatusID Times
Difference
------------------------------------------------------------------------------
1 1 4/2/07 8:32 AM
1 2 4/2/07 8:33 AM
1 1 4/2/07 8:37 AM
1 2 4/2/07 8:59 AM
1 1 4/2/07 9:11 AM
1 2 4/3/07 9:12 AM
1 2 4/3/07 9:48 AM error
1 1 4/3/07 9:49 AM
1 2 4/3/07 11:02 AM
2 1 4/3/07 6:02 PM
2 2 4/3/07 6:03 PM
2 2 4/3/07 6:04 PM error
2 1 4/3/07 6:22 PM
2 2 4/3/07 6:23 PM
3 2 4/4/07 8:37 AM error
3 2 4/4/07 8:38 AM error
3 2 4/4/07 8:39 AM error
3 2 4/4/07 12:11 PM error
3 1 4/4/07 12:12 PM
3 2 4/4/07 12:17 PM
3 1 4/4/07 12:23 PM
3 2 4/4/07 1:14 PM


In the difference column, i need to subtract the last logout from
First Login, excluding any errors which may have occurred due to
multiple logins or multiple logouts. Please note i need to mark out
errors someway, such that for every login (1) there should be a
corresponding logout below. Any other extra logins or logouts occuring
below should be marked as errors.

On another sheet, i want to summarise data.

Date EmpID FirstLogin LastLogout
Difference
-----------------------------------------------------------------------------------------
4/2/07 1
4/3/07 1
4/3/07 2
4/4/07 3

How to do accomplish this????

Any brainiacs out there who know how to achieve this using worksheet
functions or VBA?



All times are GMT +1. The time now is 02:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com