'Calculate difference between dates for each unique ID and also based on another parameter

I'm quite a beginner with Excel and I've been stuck with the following problem.

I have the following table:

enter image description here

Spreadsheet available here

For each unique "Task ID" that shows up twice, I need to calculate the difference in hours between two dates, where one date corresponds to "Travel Details" and the other corresponds to "Client Sent For".

To further clarify with an example, let's take into consideration Task ID 2552804. This shows up twice (B3 and B8), therefore I want to calculate the time difference between D8 (that is on the row "Travel Details") and D3 (that is on the row "Client Sent For"). The results should be presented as two columns, one with each unique Task ID and one with the corresponding time difference.

Any help will be highly appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source