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>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

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,425
Office Version
  1. 2019
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,651
Messages
5,838,571
Members
430,556
Latest member
Peachforyou

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
Top