SOLVED

How calculate working hours

Copper Contributor

Hi, can you all please tell me how to calculate the total working hours? The start time is 8AM, End Time is 5PM. Deduct lunchtime for 1 HOUR. 

DATETIME
2021/02/017:36:00 AM
2021/02/018:39:00 AM
2021/02/015:01:19 PM
2021/02/027:03:07 AM
2021/02/027:18:54 AM
2021/02/028:02:42 AM
2021/02/028:32:28 AM
2021/02/025:03:20 PM
2021/02/025:53:42 PM

 

10 Replies

@ANNABELLABLOG 

What do the times in your table mean?

@ANNABELLABLOG 

Here is a small approach, hope that helps.
Otherwise, as Mr. Hans Vogelaar has already written to you, please explain in more detail.

 

 

I would be happy to know if I could help.

 

 

Nikolino

I know I don't know anything (Socrates)

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

@Hans Vogelaar 

ETIME
2021/02/017:36:00 AM (Clock In)
2021/02/018:39:00 AM (Clock In again)
2021/02/015:01:19 PM (Clock out)
2021/02/027:03:07 AM 
2021/02/027:18:54 AM
2021/02/028:02:42 AM
2021/02/028:32:28 AM
2021/02/025:03:20 PM
2021/02/025:53:42 PM

 

Above the table is an employee's attendance record.  However, the standard of working hours in our company starts from 8 am till 5 pm.  The lunch hour will be deducted for 1 hour.   You may see the example above, there is the double clock in which are 7:36 am and 8:39 am. Then, I'd like to calculate it start from 7:36 am but not 08:39 am and end at 5:01:19 pm.  Now, I don't have an idea of how to formulate it.  Hopefully, professor Excel could help me solve this problem.

 

Another one is there is flexible time for employees . For the sample above, how to calculate working hours start from 07:36am till 5:01:19 and deducted for 1 hour luchbreak?

@Hans Vogelaar 

 

Kindly open the document attached. Thank you so much.

@NikolinoDE 

 

Kindly open the file as attached.  Thank you so much.

best response confirmed by allyreckerman (Microsoft)
Solution

@ANNABELLABLOG 

See the attached version. I used formulas that should work in all versions of Excel. If you have Excel 2019 or Excel in Microsoft 365, they could be simplified by using MINIFS and MAXIFS.

Thanks for the prompt reply. And thanks again for helping me formulate the working time.

@ANNABELLABLOG In case you are not on a Mac, using Excel 2013 or later and interested in a solution that doesn't involve a large number of formulae, perhaps Power Query is something for you.

 

I looked at the file you uploaded ("sample 1"), and notice you have data for several employees and months. I assume that the data will grow over time and that you want to summarise the working hours by employee/month (or perhaps by week). Then it would be easier to clean-up the time records and transform them into a neat table (via Power query) that can be the basis for a pivot table. I also noticed several instances where employees checked IN, but not OUT. Or IN twice but not OUT. Or OUT but not IN. Obviously, these entries will cause errors in an automated solution, with out extra measures. And I may not have spotted them all.

 

For what it's worth, the attached workbook takes your data into Power Query and presents a pivot table, summarising working hours (OUT -/- IN -/- 1 hour for lunch) per employee/month. It will take some learning, but certainly worth it if this is a recurring task involving large data sets. Set it up properly once and it will take a few seconds to refresh, whenever you need.

@ANNABELLABLOG 

In your sample workbook, Luk checks in on 2021/02/01 but doesn't check out. The same for Kho on 2021/02/02, etc.

1 best response

Accepted Solutions
best response confirmed by allyreckerman (Microsoft)
Solution

@ANNABELLABLOG 

See the attached version. I used formulas that should work in all versions of Excel. If you have Excel 2019 or Excel in Microsoft 365, they could be simplified by using MINIFS and MAXIFS.

View solution in original post