Plese help folmula required

Jranchhod

Board Regular
Joined
Feb 9, 2009
Messages
56
Hi, I have a table of data with clock times in and out of around 60 staff who use their cards to open the door. the staff can go in and out as many times as they need to. I need to calculate per person the difference of the persons first entry and last exit. thank you in advance
Date
Time
Person
position
01-Feb-14
08:01
a
In
01-Feb-14
08:08
b
In
01-Feb-14
16:01
a
Out
01-Feb-14
16:02
b
Out
02-Feb-14
08:02
c
In
02-Feb-14
08:03
d
In
02-Feb-14
16:30
c
Out
02-Feb-14
16:31
d
Out
03-Feb-14
08:05
e
In
03-Feb-14
08:06
f
In
03-Feb-14
16:40
e
Out
03-Feb-14
16:45
f
Out

<tbody>
</tbody>
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

StefanVL

Board Regular
Joined
Mar 7, 2013
Messages
146
Couple of questions;

Does a person enter only once a day?
Does a person only appear on one day? (i.e. a only appears on 1-feb-14)
 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,350
in E1
=SUMPRODUCT((C1=C$1:C$12)*(A1=A$1:A$12)*(D$1:D$12="In")*(B$1:B$12))
and copy down

in F1
=SUMPRODUCT((C1=C$1:C$12)*(A1=A$1:A$12)*(D$1:D$12="Out")*(B$1:B$12))
and copy down
 

Nembatic

New Member
Joined
Sep 30, 2014
Messages
3
You can always use a pivot table to display the results:
Min of TimeColumn Labels
1-Feb-142-Feb-143-Feb-14
Row LabelsInOutInOutInOut
a8:01:00 AM4:01:00 PM
b8:08:00 AM4:02:00 PM
c8:02:00 AM4:30:00 PM
d8:03:00 AM4:31:00 PM
e8:05:00 AM4:40:00 PM
f8:06:00 AM4:45:00 PM

<tbody>
</tbody><colgroup><col><col><col><col><col><col><col></colgroup>
You can then add another column subtracting the out time from the in time to get the total time. For the values choose minimum or maximum to get the correct values on the pivot table.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,348
Messages
5,528,185
Members
409,807
Latest member
nicky736

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top