I need to calculate three times during periods that span two different days.

I.e.
  1. Hours before midnight;
  2. Hours before 6.30 am and
  3. if needed the hours after 6.30am

as follows

Start Time Finish time Total Hrs B4 Midnight Decimal Total Hours Between Midnight and 6:30am Decimal After 6:30am Decimal

21:20 7:45 2:40 2.66 6:30 6.5 1:45 1.75


What is the best solutions' an 'if statement' ?