Calculate overtime per day based on multiple rows

Hi all

I'm trying to calculate the total overtime an employee has. Everything above 8 hours per day is overtime. My problem is, that an employee can have more than one entry (row) per day.

Example: 

employeeIDdateduration
101.05.202204:00:00
101.05.202203:00:00
101.05.202202:30:00
102.05.202206:00:00
102.05.202201:00:00

I need a formula that calculates the "01.05.2022" as "01:30:00" overtime and the "02.05.2022" as "-01:00:00" overtime. It should result in giving me back an overall overtime value as "00:30:00".

Is this possible to do with an app formula or google sheet formula?

Thanks in advance.
Adrian

Solved Solved
0 4 282
1 ACCEPTED SOLUTION

Hello @eddie61, you're getting that error when using @TeeSee1's solution because he assumed that you would have a DATE column in the table where you perform the calculation, which is expected, otherwise you wouldn't be able to make this calculation for different dates.

In case you actually don't need that, here is the expression without the date condition:

SUM(
 SELECT(your table[duration],[empId]=[_THISROW].[empId])
)
-
"008:00:00"

 

View solution in original post

4 REPLIES 4
Top Labels in this Space