Ben
This isn't complete but most of the way there.
Column A is date of start of work
Column B is time of start of work ( 24 hour clock )
Column C is time of end of work ( 24 hour clock )
day_end is the 17:30 time you stated.
day_start is the 07:30 you stated.
rate1 is basic hourly rate cell.
rate2 is out of hours rate cell.
it copes with day of week and going over the normal hours end time along with starting before normal hours
 |  |  |
 | Code: =IF(WEEKDAY(A15)=1,rate2*HOUR(C15-B15),IF(WEEKDAY(A15)=7,rate2*HOUR(C15-B15),IF(C15>day_end,SUM((HOUR(day_end-B15)*rate1)+(HOUR(C15-day_end)*rate2)),IF(B15>day_end,HOUR(C15-B15)*rate2,IF(B15<day_start,SUM((HOUR(day_start-B15)*rate2)+(HOUR(C15-day_start)*rate1)),HOUR(C15-B15)*rate1))))) |  |
 |  |  |
I haven't done the 30 minute deduction . I'm also struggling with anything that isn't a whole hour.

So you may need to use numbers as opposed to time.
Hope that helps I'll send you the spread sheet if you like