Calculating Total hours worked

Copper Contributor

Good day,

 

I'm looking for a formula that can get total hours worked per person given that there are multiple INs, and OUTs because of break time.

 

attached is the daily time record for the month of January.

 

advance thanks.

 

Christian 

 

IDEmployeeTime In 1Time Out 1Time In 2Time Out 2Time In 3Time Out 3Time In 4Time Out 4Time In 5Time Out 5Total hourswork
1062SHERYL MARIANO  11:22:1113:55:0214:54:4419:11:0019:26:3219:26:32   
1203CINDY LAUZON  13:15:1015:57:4616:57:3220:01:1120:16:2320:16:23   
411ALYSSA EUGENIO  10:44:1914:30:0115:25:4820:00:0220:15:33    
1153FLORDELYN G  12:14:4416:31:0817:30:4120:32:4820:47:10    
1141MARY CRIS E  13:13:4715:51:0316:51:4221:15:0121:30:00    
949MARICAR ROSALES  11:58:5213:39:0314:39:1518:37:0118:51:24    
602MARGILYN B.  11:45:5913:11:1614:07:3919:08:2519:18:29    
1089JORELYN R  12:14:2414:23:1015:23:2619:33:0419:47:58    
1092MYRANAR CERENO  11:50:4714:10:0115:10:2319:54:0220:08:3721:15:23   
997JENNY BARRAQUIO    17:19:1820:34:45 21:15:36   
1176JHOANN PINCA  11:53:1015:10:3716:11:0619:11:1019:26:54    
120JUDY  11:04:1514:07:3615:05:2818:50:1119:01:15    
5 Replies

@ChristianMercado If you can guarantee that your time records are clean, it could be as simple as entering the formula below on O2 and copy it down.

=F2+H2+J2+L2+N2-E2-G2-I2-K2-M2

However, the date provided includes many records (almost in 60% of them) with "Time IN" but no Time OUT". The opposite occurs as well, though less frequent. How would you handle those cases? None of the time records seem to carry over to the next day (i.e. start before midnight with an end after midnight). Can you confirm that this will indeed never happen?

 

Hi @ChristianMercado

 

This array formula might be helpful, but only criteria is you must have both In & out date, any one of them is missing then it will consider it as zero. as rightly said by @Riny_van_Eekelen  your time records are must be clean.

 

- Copy the below formula

- Paste in the cell & press ctrl + shift + enter 

 

=SUM(IFERROR(TIMEVALUE(IF(SEARCH("Out",$F$1:$N$1),F2:N2))-TIMEVALUE(IF(SEARCH("In",$E$1:$M$1),E2:M2)),0))

 

Please see the attached file with the formula

 

Regards, Faraz Shaikh, MCT, MIE, MOS Master, Excel Expert 

www.ExcelExciting.com

yeah, the record isn't clean because they are not taking it seriously.

Thank you very much anyway.

Christian

@ChristianMercado 

As variant

=SUMPRODUCT(($F2:$N2-$E2:$M2)*($F2:$N2>0)*($E2:$M2>0)*ISEVEN(COLUMN(F2:N2)))

 

Thanks for helping me