TIme Clock record reformatting to ???

Sleeplol

Board Regular
Joined
Apr 10, 2019
Messages
194
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello All,
I'd like some help formatting this (Tbl-A)(Loaded via Power Query)
PQdata.png


into this (Tbl-B)
FormattedData.png


What I used to populate Tbl-B Columns (All the same Index/Match formula logic):
Employee Id - IFERROR(INDEX($B$2:$B$1000, SMALL(IF(ISNUMBER(SEARCH($L$1, $C$2:$C$1000)), MATCH(ROW($C$2:$C$1000), ROW($C$2:$C$1000))), ROWS($A$2:A2))),"")
Time In - IFERROR(INDEX($A$2:$A$1000, SMALL(IF(ISNUMBER(SEARCH($L$1, $C$2:$C$1000)), MATCH(ROW($C$2:$C$1000), ROW($C$2:$C$1000))), ROWS($A$2:A2))),"")
Time Out - IFERROR(INDEX($A$2:$A$1000, SMALL(IF(ISNUMBER(SEARCH($L$2, $C$2:$C$1000)), MATCH(ROW($C$2:$C$1000), ROW($C$2:$C$1000))), ROWS($A$2:A2))),"")

Problems:
  • If someone fails to clock in or out, the entire column is thrown off
  • The In and out times are not linked to the Employee ID so they are essentially listed in order of appearance. The red on Tbl-B indicates the start of error (Matching Tbl-A)
    BothPics.png
Also, the new shifts are going to be 12 hour days and 12 hour nights, and there will ALWAYS be times that folks forget to clock in or out. So is there a way to "skip" a clock out if over 15 hours from clock in time.

Please let me know the best way of going about this whether in Power Query or excel.
Many thanks for any help with this
 
Try using this formula instead, I've refreshed the query with it in the sheet and it appears to work (by adding 1/1000 sec to the previous clock in time instead of just looking for the next one).

=IF(ROWS(I$2:I2)>COUNTIF($C$2:$C$10007,$L$1),"",MINIFS($A$2:$A$10007,$A$2:$A$10007,">"&(N(I1)+0.00000001),$C$2:$C$10007,$L$1))

Note that this still doesn't show a clock out time when a clock in has been missed. Also something that I didn't think of previously, if anyone forgets to clock out, then forgets to clock in on their next shift then it will show as a single continuous shift.

As I mentioned before, I think that with formulas trying to allow for all possible scenarios would be unrealistic.
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I see what you mean, another option (which I think does the same thing is
Excel Formula:
=IF(ROWS(I$2:I2)>COUNTIF($C$2:$C$10007,$L$1),"",AGGREGATE(15,6,(ClockTime[Timezone UTC])/(ClockTime[Timezone UTC]>N(I1))/(ClockTime[No Label]=L$1),1))
 
Upvote 0
Taking a different (but messy) approach to the task and using conditional formatting to highlight duplicates (which are caused by a missing clock in or clock out) with a yellow fill and those with a gap greater than 15 hours in a red font.

It might be possible to clean this up a bit but I'm out of ideas. I've had to split the output over 2 posts, the XL2BB code exceeds the character limit for a single one.
TimeSheet(Temps).xlsm
ABCDEFG
1Timezone UTCEmployee ID:No LabelIPInOutcounter
28/6/20 7:02 AM8907Clock IN96.65.210.858/6/20 7:02 AM8/6/20 3:05 PM1
38/6/20 9:21 AM6422Clock IN96.65.210.858/6/20 9:21 AM8/6/20 8:07 PM1
48/6/20 3:05 PM8907Clock OUT96.65.210.858/6/20 7:02 AM8/6/20 3:05 PM2
58/6/20 8:07 PM6422Clock OUT96.65.210.858/6/20 9:21 AM8/6/20 8:07 PM2
68/7/20 7:05 AM8907Clock IN96.65.210.858/7/20 7:05 AM8/7/20 2:49 PM1
78/7/20 2:49 PM6422Clock IN96.65.210.858/7/20 2:49 PM8/7/20 2:59 PM1
88/7/20 2:49 PM8907Clock OUT96.65.210.858/7/20 7:05 AM8/7/20 2:49 PM2
98/7/20 2:59 PM6422Clock OUT96.65.210.868/7/20 2:49 PM8/7/20 2:59 PM2
108/10/20 7:09 AM8907Clock IN96.65.210.858/10/20 7:09 AM8/10/20 3:08 PM1
118/10/20 8:24 AM6422Clock IN96.65.210.858/10/20 8:24 AM8/11/20 5:09 PM1
128/10/20 3:08 PM8907Clock OUT96.65.210.858/10/20 7:09 AM8/10/20 3:08 PM2
138/11/20 7:04 AM8907Clock IN96.65.210.858/11/20 7:04 AM8/11/20 3:09 PM1
148/11/20 7:56 AM6422Clock IN96.65.210.858/11/20 7:56 AM8/11/20 5:09 PM1
158/11/20 3:09 PM8907Clock OUT96.65.210.858/11/20 7:04 AM8/11/20 3:09 PM2
168/11/20 5:09 PM6422Clock OUT96.65.210.858/11/20 7:56 AM8/11/20 5:09 PM2
178/12/20 7:04 AM8907Clock IN96.65.210.858/12/20 7:04 AM8/12/20 3:02 PM1
188/12/20 3:02 PM8907Clock OUT96.65.210.858/12/20 7:04 AM8/12/20 3:02 PM2
198/13/20 7:05 AM8907Clock IN96.65.210.858/13/20 7:05 AM8/13/20 3:02 PM1
208/13/20 3:02 PM8907Clock OUT96.65.210.858/13/20 7:05 AM8/13/20 3:02 PM2
218/14/20 7:08 AM8907Clock IN96.65.210.858/14/20 7:08 AM8/14/20 3:00 PM1
228/14/20 3:00 PM8907Clock OUT96.65.210.858/14/20 7:08 AM8/14/20 3:00 PM2
238/17/20 7:06 AM8907Clock IN96.65.210.858/17/20 7:06 AM8/17/20 3:11 PM1
248/17/20 3:11 PM8907Clock OUT96.65.210.858/17/20 7:06 AM8/17/20 3:11 PM2
258/18/20 7:02 AM8907Clock IN96.65.210.858/18/20 7:02 AM8/18/20 3:03 PM1
268/18/20 3:03 PM8907Clock OUT96.65.210.858/18/20 7:02 AM8/18/20 3:03 PM2
278/19/20 7:02 AM8907Clock IN96.65.210.858/19/20 7:02 AM8/19/20 3:03 PM1
288/19/20 3:03 PM8907Clock OUT96.65.210.858/19/20 7:02 AM8/19/20 3:03 PM2
298/20/20 6:59 AM8907Clock IN96.65.210.858/20/20 6:59 AM8/20/20 3:03 PM1
308/20/20 3:03 PM8907Clock OUT96.65.210.858/20/20 6:59 AM8/20/20 3:03 PM2
318/21/20 7:01 AM8907Clock IN96.65.210.858/21/20 7:01 AM8/21/20 3:03 PM1
328/21/20 3:03 PM8907Clock OUT96.65.210.858/21/20 7:01 AM8/21/20 3:03 PM2
338/24/20 7:09 AM8907Clock IN96.65.210.858/24/20 7:09 AM8/24/20 3:01 PM1
348/24/20 3:01 PM8907Clock OUT96.65.210.858/24/20 7:09 AM8/24/20 3:01 PM2
358/25/20 7:07 AM8907Clock IN96.65.210.858/25/20 7:07 AM8/25/20 3:01 PM1
368/25/20 3:01 PM8907Clock OUT96.65.210.858/25/20 7:07 AM8/25/20 3:01 PM2
378/26/20 7:07 AM8907Clock IN96.65.210.858/26/20 7:07 AM8/26/20 12:55 PM1
388/26/20 12:55 PM8907Clock OUT96.65.210.858/26/20 7:07 AM8/26/20 12:55 PM2
398/27/20 7:04 AM8907Clock IN96.65.210.858/27/20 7:04 AM8/27/20 3:00 PM1
408/27/20 3:00 PM8907Clock OUT96.65.210.858/27/20 7:04 AM8/27/20 3:00 PM2
418/28/20 7:08 AM8907Clock IN96.65.210.858/28/20 7:08 AM8/28/20 3:03 PM1
428/28/20 3:03 PM8907Clock OUT96.65.210.858/28/20 7:08 AM8/28/20 3:03 PM2
438/31/20 7:05 AM8907Clock IN96.65.210.858/31/20 7:05 AM8/31/20 3:01 PM1
448/31/20 3:01 PM8907Clock OUT96.65.210.858/31/20 7:05 AM8/31/20 3:01 PM2
459/1/20 7:08 AM8907Clock IN96.65.210.859/1/20 7:08 AM9/1/20 2:59 PM1
469/1/20 2:59 PM8907Clock OUT96.65.210.859/1/20 7:08 AM9/1/20 2:59 PM2
479/2/20 7:05 AM8907Clock IN96.65.210.859/2/20 7:05 AM9/2/20 3:00 PM1
489/2/20 3:00 PM8907Clock OUT96.65.210.859/2/20 7:05 AM9/2/20 3:00 PM2
499/3/20 7:03 AM8907Clock IN96.65.210.859/3/20 7:03 AM9/3/20 3:02 PM1
509/3/20 3:02 PM8907Clock OUT96.65.210.859/3/20 7:03 AM9/3/20 3:02 PM2
519/4/20 7:09 AM8907Clock IN96.65.210.859/4/20 7:09 AM9/4/20 3:03 PM1
529/4/20 3:03 PM8907Clock OUT96.65.210.859/4/20 7:09 AM9/4/20 3:03 PM2
539/7/20 7:05 AM8907Clock IN96.65.210.859/7/20 7:05 AM9/7/20 3:01 PM1
549/7/20 3:01 PM8907Clock OUT96.65.210.859/7/20 7:05 AM9/7/20 3:01 PM2
559/8/20 7:04 AM8907Clock IN96.65.210.859/8/20 7:04 AM9/8/20 3:11 PM1
569/8/20 3:11 PM8907Clock OUT96.65.210.859/8/20 7:04 AM9/8/20 3:11 PM2
579/9/20 7:03 AM8907Clock IN96.65.210.859/9/20 7:03 AM9/9/20 3:06 PM1
589/9/20 3:06 PM8907Clock OUT96.65.210.859/9/20 7:03 AM9/9/20 3:06 PM2
599/10/20 7:07 AM8907Clock IN96.65.210.859/10/20 7:07 AM9/10/20 3:01 PM1
609/10/20 3:01 PM8907Clock OUT96.65.210.859/10/20 7:07 AM9/10/20 3:01 PM2
619/11/20 7:09 AM8907Clock IN96.65.210.859/11/20 7:09 AM9/11/20 3:01 PM1
629/11/20 3:01 PM8907Clock OUT96.65.210.859/11/20 7:09 AM9/11/20 3:01 PM2
639/14/20 7:05 AM8907Clock IN96.65.210.859/14/20 7:05 AM9/14/20 3:01 PM1
649/14/20 3:01 PM8907Clock OUT96.65.210.859/14/20 7:05 AM9/14/20 3:01 PM2
659/15/20 7:09 AM8907Clock IN96.65.210.859/15/20 7:09 AM9/15/20 3:01 PM1
669/15/20 7:30 AM8838Clock IN96.65.210.859/15/20 7:30 AM9/15/20 4:02 PM1
679/15/20 7:31 AM7840Clock IN96.65.210.859/15/20 7:31 AM9/15/20 4:01 PM1
689/15/20 3:01 PM8907Clock OUT96.65.210.859/15/20 7:09 AM9/15/20 3:01 PM2
699/15/20 4:01 PM7840Clock OUT96.65.210.859/15/20 7:31 AM9/15/20 4:01 PM2
709/15/20 4:02 PM8838Clock OUT96.65.210.859/15/20 7:30 AM9/15/20 4:02 PM2
719/16/20 6:54 AM7840Clock IN96.65.210.859/16/20 6:54 AM 1
729/16/20 6:54 AM8838Clock IN96.65.210.859/16/20 6:54 AM 1
739/16/20 7:03 AM8907Clock IN96.65.210.859/16/20 7:03 AM 1
DATA
Cell Formulas
RangeFormula
E2:E73E2=IF([@[No Label]]=$O$1,[@[Timezone UTC]],IFERROR(1/(1/MAXIFS([Timezone UTC],[Employee ID:],[@[Employee ID:]],[No Label],$O$1,[Timezone UTC],"<"&[@[Timezone UTC]])),""))
F2:F73F2=IF([@[No Label]]=$O$2,[@[Timezone UTC]],IFERROR(1/(1/MINIFS([Timezone UTC],[Employee ID:],[@[Employee ID:]],[No Label],$O$2,[Timezone UTC],">"&[@[Timezone UTC]])),""))
G2:G73G2=COUNTIFS(B$2:B2,B2,E$2:E2,E2,F$2:F2,F2)
 
Upvote 0
Second part, column H is empty to keep the 2 tables separate.
TimeSheet(Temps).xlsm
IJKLMN
1EmployeeEmployee IDTIME INTIME OUTClock IN
2Joseph Dutch89078/6/20 7:02 AM8/6/20 3:05 PMClock OUT
3Brent Wilette64228/6/20 9:21 AM8/6/20 8:07 PM
4Joseph Dutch89078/7/20 7:05 AM8/7/20 2:49 PM
5Brent Wilette64228/7/20 2:49 PM8/7/20 2:59 PM
6Joseph Dutch89078/10/20 7:09 AM8/10/20 3:08 PM
7Brent Wilette64228/10/20 8:24 AM8/11/20 5:09 PM
8Joseph Dutch89078/11/20 7:04 AM8/11/20 3:09 PM
9Brent Wilette64228/11/20 7:56 AM8/11/20 5:09 PM
10Joseph Dutch89078/12/20 7:04 AM8/12/20 3:02 PM
11Joseph Dutch89078/13/20 7:05 AM8/13/20 3:02 PM
12Joseph Dutch89078/14/20 7:08 AM8/14/20 3:00 PM
13Joseph Dutch89078/17/20 7:06 AM8/17/20 3:11 PM
14Joseph Dutch89078/18/20 7:02 AM8/18/20 3:03 PM
15Joseph Dutch89078/19/20 7:02 AM8/19/20 3:03 PM
16Joseph Dutch89078/20/20 6:59 AM8/20/20 3:03 PM
17Joseph Dutch89078/21/20 7:01 AM8/21/20 3:03 PM
18Joseph Dutch89078/24/20 7:09 AM8/24/20 3:01 PM
19Joseph Dutch89078/25/20 7:07 AM8/25/20 3:01 PM
20Joseph Dutch89078/26/20 7:07 AM8/26/20 12:55 PM
21Joseph Dutch89078/27/20 7:04 AM8/27/20 3:00 PM
22Joseph Dutch89078/28/20 7:08 AM8/28/20 3:03 PM
23Joseph Dutch89078/31/20 7:05 AM8/31/20 3:01 PM
24Joseph Dutch89079/1/20 7:08 AM9/1/20 2:59 PM
25Joseph Dutch89079/2/20 7:05 AM9/2/20 3:00 PM
26Joseph Dutch89079/3/20 7:03 AM9/3/20 3:02 PM
27Joseph Dutch89079/4/20 7:09 AM9/4/20 3:03 PM
28Joseph Dutch89079/7/20 7:05 AM9/7/20 3:01 PM
29Joseph Dutch89079/8/20 7:04 AM9/8/20 3:11 PM
30Joseph Dutch89079/9/20 7:03 AM9/9/20 3:06 PM
31Joseph Dutch89079/10/20 7:07 AM9/10/20 3:01 PM
32Joseph Dutch89079/11/20 7:09 AM9/11/20 3:01 PM
33Joseph Dutch89079/14/20 7:05 AM9/14/20 3:01 PM
34Joseph Dutch89079/15/20 7:09 AM9/15/20 3:01 PM
35Calvin Lane88389/15/20 7:30 AM9/15/20 4:02 PM
36Mick Franklin78409/15/20 7:31 AM9/15/20 4:01 PM
37Mick Franklin78409/16/20 6:54 AM 
38Calvin Lane88389/16/20 6:54 AM 
39Joseph Dutch89079/16/20 7:03 AM 
40    
DATA
Cell Formulas
RangeFormula
I2:I40I2=IFERROR(VLOOKUP([@[Employee ID]],Temps!E:F,2,FALSE),"")
J2:J40J2=IFERROR(INDEX(ClockTime[Employee ID:],AGGREGATE(15,6,ROW(ClockTime[counter])/(ClockTime[counter]=1),ROWS(J$2:J2))-1),"")
K2:K40K2=IFERROR(INDEX(ClockTime[In],AGGREGATE(15,6,ROW(ClockTime[counter])/(ClockTime[counter]=1),ROWS(J$2:J2))-1),"")
L2:L40L2=IFERROR(INDEX(ClockTime[Out],AGGREGATE(15,6,ROW(ClockTime[counter])/(ClockTime[counter]=1),ROWS(J$2:J2))-1),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K2:L40Cell ValueduplicatestextNO
K2:L40Expression=($L2-$K2)>TIME(15,0,0)textNO
 
Upvote 0
Sorry for getting back so late with this reply

Hi Fluff,
Thanks for your formula, yes it works great.

Hi Jason,
Man, I really appreciate all you effort with this. I've incorporated your last post which makes it super easy to see IN and OUT 'errors'. Using your update I'm putting in an "If" function column so that when they run reports (Script uses Advanced Filter) they'll see "Verify Time".
 
Upvote 0

Forum statistics

Threads
1,216,000
Messages
6,128,204
Members
449,435
Latest member
Jahmia0616

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