JoeyGaspard
Board Regular
- Joined
- Jul 22, 2019
- Messages
- 164
I get a text report from our time keeping system that i dump into excel through a data connection and I need to calculate the total hours for a day, the problem is, some employees clock in and out for lunch, so there could be up to 4 punches per day per employee. I am trying to automate it so that it will subtract the clockin time from the lunch clock out time, and the lunch clock in from the end of the day clockout to give me total hours worked for the day. Example, if I have these 4 times:
7.82
12.60
13.02
16.66
I need to subtract 7.82 from 12.60 and 13.02 from 16.62, and then add the two numbers together for the total for the day. I have no problem doing this if everyone clocked 4 punches a day, but some clock 2 times, and others 4, just depends on whether they leave for lunch. I get the data with a date and time stamp, is there a way to do this either with vba or a formula? I need excel to recognize whether there are 2 or 4 punches so it will know what to subtract from what? Any help is greatly appreciated! Here is an example of what the data looks like:
I convert it 100 minute time also.
7.82
12.60
13.02
16.66
I need to subtract 7.82 from 12.60 and 13.02 from 16.62, and then add the two numbers together for the total for the day. I have no problem doing this if everyone clocked 4 punches a day, but some clock 2 times, and others 4, just depends on whether they leave for lunch. I get the data with a date and time stamp, is there a way to do this either with vba or a formula? I need excel to recognize whether there are 2 or 4 punches so it will know what to subtract from what? Any help is greatly appreciated! Here is an example of what the data looks like:
19999 | 2021-04-05 07:49:19.000 | CLARK | LEAH | 07:49:19.000 |
19999 | 2021-04-05 12:36:11.000 | CLARK | LEAH | 12:36:11.000 |
19999 | 2021-04-05 13:01:25.000 | CLARK | LEAH | 13:01:25.000 |
19999 | 2021-04-05 16:39:43.000 | CLARK | LEAH | 16:39:43.000 |
19999 | 2021-04-06 07:46:02.000 | CLARK | LEAH | 07:46:02.000 |
19999 | 2021-04-06 12:30:33.000 | CLARK | LEAH | 12:30:33.000 |
19999 | 2021-04-06 13:06:53.000 | CLARK | LEAH | 13:06:53.000 |
19999 | 2021-04-06 16:46:06.000 | CLARK | LEAH | 16:46:06.000 |
19999 | 2021-04-07 07:55:45.000 | CLARK | LEAH | 07:55:45.000 |
19999 | 2021-04-07 11:38:46.000 | CLARK | LEAH | 11:38:46.000 |
19999 | 2021-04-07 12:10:14.000 | CLARK | LEAH | 12:10:14.000 |
19999 | 2021-04-07 16:30:03.000 | CLARK | LEAH | 16:30:03.000 |
19999 | 2021-04-08 07:50:41.000 | CLARK | LEAH | 07:50:41.000 |
19999 | 2021-04-08 16:34:03.000 | CLARK | LEAH | 16:34:03.000 |
19999 | 2021-04-09 07:18:18.000 | CLARK | LEAH | 07:18:18.000 |
I convert it 100 minute time also.