I think taht while it would be possible to do with a formula, the formula would be large and unwieldy. A UDF would be easier to create and maintain.
Try this
Function WorkTime(Breaks As Range, Shift As Variant, CurTime As Date) As Variant
Dim Lunch As Date
Dim Break1 As Date
Dim Break2 As Date
Dim v As Variant
Dim BreakTime As Long
With Application
v = .Match(Shift, Breaks.Columns(1), 0)
Lunch = .Index(Breaks.Columns(3), v)
Break1 = .Index(Breaks.Columns(2), v)
Break2 = .Index(Breaks.Columns(4), v)
End With
v = DateDiff("n", CurTime, Lunch)
Select Case v
Case -30 To 0
BreakTime = 30 + v
Case 0 To 30
BreakTime = 30 - v
End Select
v = DateDiff("n", CurTime, Break1)
Select Case v
Case -15 To 0
BreakTime = BreakTime + 15 + v
Case 0 To 15
BreakTime = BreakTime + v
Case 15 To 30
BreakTime = BreakTime + 30 - v
End Select
v = DateDiff("n", CurTime, Break2)
Select Case v
Case -15 To 0
BreakTime = BreakTime + 15 + v
Case 0 To 15
BreakTime = BreakTime + v
Case 15 To 30
BreakTime = BreakTime + 30 - v
End Select
WorkTime = 1# - BreakTime / 30#
End Function