Results 1 to 2 of 2
Thread: Time formula problem

20091125, 04:43 #1
 Join Date
 Aug 2001
 Location
 Surrey, United Kingdom
 Posts
 1,001
 Thanks
 0
 Thanked 0 Times in 0 Posts
Good morning
I have problems with a formula and would appreciate some help
I have 2 columns both formatted as [h]:mm the 3rd has the formula I2J2 and is also formatted as [h]:mm which is fine if the time in I2 is higher than J2 but returns #### if I2 is less than J2. I have read through Chip Pearsons site Date Arithmatic which shows this
"Time Intervals
You can determine the number of hours and minutes between two times by subtracting the two times. However, since Excel cannot handle negative times, you must use an =IF statement to adjust the time accordingly. If your times were entered without a date (e.g, 22:30), the following statement will compute the interval between two times in A1 and B1 .
=IF(A1>B1,B1+1A1,B1A1)
The "+1" in the formula causes Excel to treat B1 as if it were in the next day, so 02:3022:00 will result in 4:30, four hours and thirty minutes, which is what we would expect. To covert this to a decimal number, for example, 4.5, indicating how many hours, multiply the result by 24 and format the cell as General or Decimal, as in
=24*(IF(A1>B1,B1+1A1,B1A1))"
So I have entered this =24*(IF(I2>J2,J2+1I2,J2I2)) the time in I2 = 48:00 and J2 = 44:10 but with the target cell formatted as [h]:mm I get a result of 484, If I format it as General I get 20.166 recurring and if I format it as Number I get 20.17?
The examples in the graphic below show my original formula in L and Chip's in M
Any ideas pleaseCheers
Steve
Asking the questions everbody wants the answers too but feels too stupid to ask themselves :)

20091125, 05:11 #2
 Join Date
 Mar 2002
 Posts
 84,353
 Thanks
 0
 Thanked 30 Times in 30 Posts
1. Chip Pearson's formulas are intended for clock time, not for cumulative time.
2. The result of the formula, as explicitly stated, is the number of hours converted to a decimal number, so you shouldn't format it as time.
Try this formula instead:
=24*(J2I2)
and format the result as General or as Number with the desired number of decimal places.