Let me illustrate what I'm trying to do with an example.

Columns A & B usually contain 9:00 & 17:30 respectively, however, at times they may contain values that differ. E.g. 9:00 & 20:20 or 7:50 & 22:35. Now, what I'm trying to do is sum up the hours that come before "9:00" in column A and after "22:00" in column B. Meaning that the result for the latter example would be 1:10 + 0:35 = 2:45. After that, I need to sum up all the rows containing the mentioned sums but I assume that this will be a simple SUM calculation though feel free to correct me if I'm wrong.

Please let me know if you have questions.

Many thanks!