Need to extract In & Out time of employees

leena24

Board Regular
Joined
Apr 21, 2007
Messages
63
Hi

I have an in & Out time of employees and I need to find out , how much time they have spent out of a particular floor on a particular day.

Unique field are date and the card number which is used at entry and exit point of the floor. There is a time field which provides time spent in or outside the floor.

'reader in' means employee entered and 'reader out' means employee went out. The time difference on a particular date's 'reader in' & 'reader out' will
provide the actual time spent out of a particular floor. Which in my case is the 9th floor. Which means how much time an employee spent in a day out of 09th floor.

The data is for entire month and for multiple employees (which could be identifyied basis unique "card number".

The spread sheet looks like this, Date is in column A , Time in b , Reader in C, Card Number in D, name in E :
Date Time Reader Card Number Name
4/1/2015 10:01:00 AM 9 FLOOR RECEPTION C 14 - Reader IN 41363 XYZ
4/1/2015 11:53:00 AM 9 FLOOR FIRE EXIT C13 - Reader OUT 41363 XYZ
4/1/2015 11:54:00 AM 11 FLOOR FIRE EXIT - Reader IN 41363 XYZ
4/1/2015 12:05:00 PM 11 FLOOR FIRE EXIT - Reader OUT 41363 XYZ
4/1/2015 12:06:00 PM 9 FLOOR FIRE EXIT C13 - Reader IN 41363 XYZ
4/1/2015 2:16:00 PM 9 FLOOR FIRE EXIT C13 - Reader OUT 41363 XYZ
4/1/2015 2:17:00 PM 11 FLOOR FIRE EXIT - Reader IN 41363 XYZ
4/1/2015 2:39:00 PM 11 FLOOR FIRE EXIT - Reader OUT 41363 XYZ
4/1/2015 2:40:00 PM 9 FLOOR FIRE EXIT C13 - Reader IN 41363 XYZ
4/1/2015 2:42:00 PM 9 FLOOR RECEPTION C 14 - Reader OUT 41363 XYZ
4/1/2015 3:07:00 PM 9 FLOOR RECEPTION C 14 - Reader IN 41363 XYZ
4/1/2015 7:13:00 PM 9 FLOOR RECEPTION C 14 - Reader OUT 41363 XYZ
4/1/2015 8:48:00 AM 9 FLOOR RECEPTION C 14 - Reader IN 6481 ABC
4/1/2015 10:56:00 AM 9 FLOOR RECEPTION C 14 - Reader OUT 6481 ABC
4/1/2015 11:06:00 AM 9 FLOOR RECEPTION C 14 - Reader IN 6481 ABC
4/1/2015 11:37:00 AM 9 FLOOR RECEPTION C 14 - Reader OUT 6481 ABC
4/1/2015 11:49:00 AM 9 FLOOR RECEPTION C 14 - Reader IN 6481 ABC
4/1/2015 3:30:00 PM 9 FLOOR RECEPTION C 14 - Reader IN 6481 ABC
4/1/2015 6:00:00 PM 9 FLOOR RECEPTION C 14 - Reader OUT 6481 ABC
4/1/2015 10:06:00 AM 9 FLOOR RECEPTION C 14 - Reader IN 6894 EFG
4/1/2015 1:07:00 PM 9 FLOOR FIRE EXIT C13 - Reader OUT 6894 EFG
4/1/2015 1:08:00 PM 11 FLOOR FIRE EXIT - Reader IN 6894 EFG
4/1/2015 1:22:00 PM 11 FLOOR FIRE EXIT - Reader OUT 6894 EFG
4/1/2015 1:23:00 PM 9 FLOOR FIRE EXIT C13 - Reader IN 6894 EFG
4/1/2015 2:15:00 PM 9 FLOOR RECEPTION C 14 - Reader OUT 6894 EFG
4/1/2015 2:49:00 PM 9 FLOOR RECEPTION C 14 - Reader IN 6894 EFG
4/1/2015 7:12:00 PM 9 FLOOR RECEPTION C 14 - Reader OUT 6894 EFG




As an end out put following is required, for each employee, date wise :

Date | Card number | name | total time out of 9th floor | time spent on other floors |


Request if anyone in the forum lets me know if this could be done in excel and help me in getting this. Pls note, I use excel 2002 version.


Regards.
Leena
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Please post a photo of the spreadsheet. As it is now, it is difficult to tell what exactly is in the columns.
 
Upvote 0
Hi,
Have you tried using autofilter? You then need only add a formula in a vacant cell to calculate the time difference

Dave
 
Upvote 0
Something wrong with the url. See a blank page.
 
Upvote 0
In the first row : date is in cell a1, time is in cell b1 it ends at am/ pm, reader i n cell c1 it ends at IN/OUT, NUMERIC number is the card number in d1 and name in cell e1 which contains only alpha ( xyz, abc etc) . It keeps going on below for the next record. Hope it helps. Will try to upload the picture again.
Thanks
 
Upvote 0
Hi

To make this easier, I recommend you add some new columns to your data with formulas like this:


ABCDEFGHIJKL
1
DateTimeReadingCard#EmployeeEmp.DateUniqueFloorIn/OutKeyLast InElapsed
2
4/01/1510:01:00 a.m.9 FLOOR RECEPTION C 14 - Reader IN41363XYZ42008XYZ19IN42008XYZ9IN
34/01/1511:53:00 a.m.9 FLOOR FIRE EXIT C13 - Reader OUT41363XYZ42008XYZ19OUT42008XYZ9OUT10:01:0001:52:00
44/01/1511:54:00 a.m.11 FLOOR FIRE EXIT - Reader IN41363XYZ42008XYZ111IN42008XYZ11IN
54/01/1512:05:00 p.m.11 FLOOR FIRE EXIT - Reader OUT41363XYZ42008XYZ111OUT42008XYZ11OUT11:54:0000:11:00

<tbody>
</tbody>
Sheet2


The formulas are (copy all formulas down for your data):
F2 : =A2&E2
G2 : =MAX(G$1:G1)+(COUNTIF(F$1:F2,F2)=1)
H2 : =1*LEFT(C2,SEARCH(" ",C2))
I2 : =IF(ISERROR(SEARCH("IN",C2)),"OUT","IN")
J2 : =F2&H2&I2
K2 : =IF(I2="OUT",LOOKUP(2, 1/(J1:J$2=CONCATENATE(A2&E2&H2&"IN")), B1:B$2),"")
L2 : =IF(LEN(K2)>0,B2-K2,"")

Then build yourself a summary like this:


OPQRSTU
1
Summary:
2
3UniqueRowDateCardNameOn 9thOn Others
4124 Jan 1541363XYZ08:10:0000:33:00
52144 Jan 156481ABC05:09:0000:00:00
63214 Jan 156894EFG08:16:0000:14:00
7000:00:0000:00:00
8000:00:0000:00:00

<tbody>
</tbody>
Sheet2

Create the headings and enter the value 1 into cell O4. I created this summary table to the right of the data in the same sheet.

The formulas are: (again copy them all down)
P4: =IF(LEN(O4)>0,MATCH(O4,G:G,0),0)
Q4: =IF($P4>0,INDEX($A:$E,$P4,1),"")
R4: =IF($P4>0,INDEX($A:$E,$P4,4),"")
S4: =IF($P4>0,INDEX($A:$E,$P4,5),"")
T4: =SUMIF(J:J,Q4&S4&"9OUT",L:L)
U4: =SUMIF(F:F,Q4&S4,L:L)-T4
O5: =IF(MAX(G:G)>O4,O4+1,"")

The summary will be pretty much self-maintaining, if you need extra rows just copy the last row down as many as you need. It would probably be better to move the summary to another sheet. Then you can apply some filters to look at particular employees. Please note the data and summary is sequence sensitive so that if you re-sort the data, you may end up with errors. The time columns (T & U) will need to be formatted as hh:mm:ss or some such variation.

I trust this helps.
Andrew
 
Last edited:
Upvote 0
Many thanks Andrew. I will try this and will get back. What i have is a montly data for employees. Just hoping that it summarises daywise for each employee which i can later put a pivot to for final monthly summary. ?
 
Upvote 0
Please post a photo of the spreadsheet. As it is now, it is difficult to tell what exactly is in the columns.
I know the OP already responded to your request, but here is something to try first in the future... click "Reply With Quotes" for the message with the layout you can't read... if you are in Source Mode (where the first icon in the Reply Box's window, with the small capital A/slash/large underlined capital A, is highlighted), the default I believe, then the actual layout the OP posted will display... in this case, the format is readable and can be copied.
 
Upvote 0

Forum statistics

Threads
1,214,631
Messages
6,120,645
Members
448,974
Latest member
DumbFinanceBro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top