Solved difference between days and hours (Question for Excel)

December 30, 2015 at 09:25:10
Specs: Windows 7
I have a duration in one cell dd hh:mm:ss: 15 11:02:23 I need to substract 14 23:06:40
from it?
Does anyone know how to do this in excel?

Thanks for your help.

message edited by Agi

See More: difference between days and hours (Question for Excel)

Report •

December 30, 2015 at 09:55:23
Perhaps if you started here...

...and worked your way to here:'d find a way to accomplish your goal.

Let us know if you get stuck.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

December 30, 2015 at 13:11:53
✔ Best Answer
Probably the simplest way would be to separate the Days from the Hours then do the math, so you data would look like:

     A       B
1) Days    Hours
2)  15    11:02:23
3)  14    23:06:40

Then in cell B4 enter the formula:


We first have to check to make sure the beginning hour, in cell B2,
is greater then the ending hour, in cell B3,
if it is not, then we need to add 1 day to the beginning hour.
Then do the subtraction.

The formula for cell A4, the Days would be:


Again, we first check the hours to make sure the beginning hour is
greater then the endng hour, and if not, we have to subtract 1 day
from our beginning day figure.
Then do the subtraction.

Having both the Days and Hours in one cell only makes matter more difficult.
There probably is a very long and complicted formula you could write
using MID and FIND to cut up the strings and then do the math, but by
separating them we can do it with two relatively simple formulas.


Report •

Related Solutions

Ask Question