I need someones help to write a formula to calculate hourly rates from a price matrix for different areas at daytime, night and weekend.

Please see a detailed, short description of the issue in the attached file.

Maximum working hours is from 7:00 AM to 11:59 PM.

I have tried for hours now I need help from an excelgur!

ParolisaCalculate total price from time and matrix.xlsx