Good afternoon and Happy Memorial Day,
I could use help creating formulas to answer several meal period related questions from employee time punch data. I have 61 worksheets each representing a Pay Week with approximately 216,000+ rows per worksheet. And, there are two steps in the analysis I need to accomplish.
Step #1: I need formulas to answer YES/NO (or 1/0) each of the following: (1) clocked out for a meal period after working more than 5 hours; (2) clocked out for a meal period that was less than 30 minutes; and (3) failed to clock out for a 30-minute meal period after working more than 5 hours. Example worksheet is below with "COMPANY"=Column A thru "HOURS_QTY"=Column M. I have only provided the first few rows where 3 employees' time punch data is shown (the change in employee is when the EMPLID changes). The time punches are shown under "START_TM_DEC" (start time) and "END_TM_DEC" (end time). Note the "START_DT" and "END_DT" as the date the employee worked. Disregard the "PAY_END_DT". An employee punches in for the day, punches out for lunch (hopefully) [that's one row], punches in from lunch, punches out for the day [that's the next row]. Hope this makes sense. It's the employee change every few rows that is giving me difficulty coming up with formulas.
COMPANY | PAYGROUP | EMPLID | ERNCD | START_DT | START_TM_DEC | END_DT | END_TM_DEC | PAY_END_DT | LOCATION | WORKED_DEPT | WORKED_JOBCODE | HOURS_QTY |
002 | 029 | 1095693 | 001 | 4/17/2006 | 1.3333 | 4/17/2006 | 7.1833 | 4/23/2006 | 2406A | 301 | 11988 | 5.75 |
002 | 029 | 1095693 | 001 | 4/17/2006 | 7.7 | 4/17/2006 | 9.85 | 4/23/2006 | 2406A | 301 | 11988 | 2.25 |
002 | 029 | 1095693 | 101 | 4/17/2006 | 9.85 | 4/17/2006 | 10.2333 | 4/23/2006 | 2406A | 301 | 11988 | 0.5 |
002 | 029 | 1095693 | 001 | 4/18/2006 | 1.4 | 4/18/2006 | 7.4 | 4/23/2006 | 2406A | 301 | 11988 | 6 |
002 | 029 | 1095693 | 001 | 4/18/2006 | 7.85 | 4/18/2006 | 9.7667 | 4/23/2006 | 2406A | 301 | 11988 | 2 |
002 | 029 | 1095693 | 001 | 4/19/2006 | 1.25 | 4/19/2006 | 6.8333 | 4/23/2006 | 2406A | 301 | 11988 | 5.5 |
002 | 029 | 1095693 | 001 | 4/19/2006 | 7.2833 | 4/19/2006 | 9.7 | 4/23/2006 | 2406A | 301 | 11988 | 2.5 |
002 | 029 | 1095693 | 101 | 4/19/2006 | 9.7 | 4/19/2006 | 9.7167 | 4/23/2006 | 2406A | 301 | 11988 | 0 |
002 | 029 | 1095693 | 101 | 4/19/2006 | 9.7167 | 4/19/2006 | 10.2167 | 4/23/2006 | 2406A | 301 | 11988 | 0.5 |
002 | 029 | 1095693 | 001 | 4/20/2006 | 1.1167 | 4/20/2006 | 7.1167 | 4/23/2006 | 2406A | 301 | 11988 | 6 |
002 | 029 | 1095693 | 001 | 4/20/2006 | 7.6667 | 4/20/2006 | 9.6333 | 4/23/2006 | 2406A | 301 | 11988 | 2 |
002 | 029 | 1095693 | 007 | 4/23/2006 | 1.0833 | 4/23/2006 | 6.9333 | 4/23/2006 | 2406A | 301 | 11988 | 5.75 |
002 | 029 | 1095693 | 007 | 4/23/2006 | 7.4667 | 4/23/2006 | 9.6167 | 4/23/2006 | 2406A | 301 | 11988 | 2.25 |
002 | 029 | 1095693 | 107 | 4/23/2006 | 9.6167 | 4/23/2006 | 9.6833 | 4/23/2006 | 2406A | 301 | 11988 | 0 |
002 | 029 | 1136968 | 001 | 4/18/2006 | 7.6833 | 4/18/2006 | 11.45 | 4/23/2006 | 2373A | 316 | 11065 | 3.75 |
002 | 029 | 1136968 | 081 | 4/18/2006 | 12.3667 | 4/18/2006 | 15.6833 | 4/23/2006 | 2373A | 349 | 11009 | 3.25 |
002 | 029 | 1136968 | 081 | 4/18/2006 | 15.6833 | 4/18/2006 | 16.6 | 4/23/2006 | 2373A | 349 | 11009 | 1 |
002 | 029 | 1136968 | 101 | 4/18/2006 | 11.45 | 4/18/2006 | 12.3667 | 4/23/2006 | 2373A | 316 | 11065 | 1 |
002 | 029 | 1136968 | 001 | 4/19/2006 | 8.85 | 4/19/2006 | 14.6667 | 4/23/2006 | 2373A | 316 | 11065 | 5.75 |
002 | 029 | 1136968 | 001 | 4/22/2006 | 9.8167 | 4/22/2006 | 17.8167 | 4/23/2006 | 2373A | 316 | 11065 | 8 |
002 | 029 | 1136968 | 101 | 4/22/2006 | 17.8167 | 4/22/2006 | 18.3833 | 4/23/2006 | 2373A | 316 | 11065 | 0.5 |
002 | 029 | 1136968 | 007 | 4/23/2006 | 5.7333 | 4/23/2006 | 11.2833 | 4/23/2006 | 2373A | 316 | 11065 | 5.5 |
002 | 029 | 1136968 | 007 | 4/23/2006 | 11.7333 | 4/23/2006 | 14.1833 | 4/23/2006 | 2373A | 316 | 11065 | 2.5 |
002 | 029 | 1136968 | 107 | 4/23/2006 | 14.1833 | 4/23/2006 | 14.7333 | 4/23/2006 | 2373A | 316 | 11065 | 0.5 |
002 | 029 | 1137137 | 001 | 4/17/2006 | 2.9167 | 4/17/2006 | 9.3333 | 4/23/2006 | 2146A | 301 | 11988 | 6.5 |
002 | 029 | 1137137 | 001 | 4/18/2006 | 2.1 | 4/18/2006 | 5.1167 | 4/23/2006 | 2146A | 301 | 11988 | 3 |
002 | 029 | 1137137 | 001 | 4/18/2006 | 5.4833 | 4/18/2006 | 9.7 | 4/23/2006 | 2146A | 301 | 11988 | 4.25 |
002 | 029 | 1137137 | 001 | 4/19/2006 | 0.0667 | 4/19/2006 | 4.8833 | 4/23/2006 | 2146A | 301 | 11988 | 4.75 |
002 | 029 | 1137137 | 001 | 4/19/2006 | 5.7333 | 4/19/2006 | 8.85 | 4/23/2006 | 2146A | 301 | 11988 | 3.25 |
002 | 029 | 1137137 | 001 | 4/21/2006 | 2.4333 | 4/21/2006 | 5.3833 | 4/23/2006 | 2146A | 301 | 11988 | 3 |
002 | 029 | 1137137 | 007 | 4/23/2006 | 0.2667 | 4/23/2006 | 1.15 | 4/23/2006 | 2146A | 301 | 11988 | 1 |
002 | 029 | 1137137 | 007 | 4/23/2006 | 4.7333 | 4/23/2006 | 5.8667 | 4/23/2006 | 2146A | 301 | 11988 | 1 |
Step #2: With the answers to the above, where there is a YES (or 1) it is considered a "penalty". Whether an employee receives 1 or 5 "penalties" in a pay week we only count it as 1 penalty. Across all 61 worksheets, if this is at all possible somehow, I then need to calculate in dollars the "penalties" per employee. $100 per pay week for the first "penalty". $200 for every pay week there is a subsequent "penalty".
This forum has helped me immensely over the years with complicated time punch formulas and I hope a kind soul can assist me again.
Thank you very much! Elsa