'Calculate the total time taken from dates in multiple columns in Excel

I want to calculate the time difference in hours and show it in a new column.

For example time taken from Initial Contact (A2) to Response Time (B2) and show it in E2. AND time taken from F/U Contact (C4) to Response Time (D4) and show it in E4.

enter image description here



Solution 1:[1]

Here is the answer and thanks to Scott Craner. I had tried different formulas like DATEDIF, IF etc and nothing worked. But the below formula suggested by Scott worked like magic!

=SUM(-A2,B2,-C2,D2) and format the cell to display time in hours and minutes [h]:mm. enter image description here

Solution 2:[2]

strrep("_", 70) this is just a base R function

[1] "______________________________________________________________________"

Solution 3:[3]

print(paste(rep("_", 70), collapse = ""))

This works, but maybe there is a more elegant solution (it should also work without print())

Sources

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

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Merijn van Tilborg
Solution 3 bt-koch