Function OverHours(Data As Range) rw = Data.Row x = 0 For i = 6 To 170 Step 4 If IsNumeric(Cells(rw, i)) And Cells(rw, i + 1) > 0 And Cells(rw, i) > 0 Then hrs = Cells(rw, i + 1) - Cells(rw, i) If hrs < 0 Then hrs = hrs + 1 y = y + hrs Z = Z + 1 If hrs > 0.5 Then x = x + 1 End If End If Next If y > 0 Then OverHours = Format(y * 24, "0.0") & " hours in " & Z & " shifts with " & x & " over 12 hours" Else OverHours = "No hours recorded" End If End Function