I need a help with a formula that will only check the time in a date & time and subtraction base on Column B3 and C 3

what is need is need a worker is meant to start at 12:30 and end 15:00 in each day so if the work should start work by 6am or 7am the formula should take to subtract the end time from 12:30

IF Column B5 Time is less than Column B3 time and column C5 time is equal to Column C3 then subtract C5-B5

IF Column B5 Time is Equal or Grater than B3 time and Column C5 is Grater Than C3 The Subtract C3-B5

I hope any one will understand all i need in formula

Book2 (version 1).xlsb | |||||
---|---|---|---|---|---|

B | C | D | |||

3 | 12:30 | 15:00 | |||

4 | START TIME | END TIME | ANSWER | ||

5 | 06/08/22 12:30 | 06/08/22 15:00 | FALSE | ||

6 | 06/08/22 06:00 | 06/08/22 22:00 | |||

7 | 06/08/22 11:30 | 06/08/22 15:00 | |||

8 | 06/08/22 00:10 | 06/08/22 15:00 | |||

9 | 06/08/22 14:59 | 06/08/22 17:00 | |||

10 | 06/08/22 12:00 | 06/08/22 14:00 | |||

11 | 06/08/22 00:01 | 06/08/22 23:00 | |||

12 | 06/08/22 05:00 | 06/08/22 13:30 | |||

13 | 06/08/22 07:00 | 08/08/22 09:00 | |||

Sheet1 |

Cell Formulas | ||
---|---|---|

Range | Formula | |

D5 | D5 | =IF(AND(B3=B5,C3=C5,C5>B5),C5-B5) |