I have two cells, each one have a clock in it, like 14:30 and 22:00
Now I want to calculate how many hours/minuts there is between
the two clocks, and the result to be showed in a third cell.
How can I do this ?
muddan madhu - 31 May 2008 13:22 GMT
In A1 u have 14:30 & B1 = 22:00, Put C1 =IF(A1>B1,A1-B1,B1-A1)
then for the C1 set the number format [h]:mm
> I have two cells, each one have a clock in it, like 14:30 and 22:00
> Now I want to calculate how many hours/minuts there is between
> the two clocks, and the result to be showed in a third cell.
>
> How can I do this ?
Mais qui est Paul - 31 May 2008 13:36 GMT
Bonsour® SpookiePower avec ferveur ;o))) vous nous disiez :
> I have two cells, each one have a clock in it, like 14:30 and 22:00
> Now I want to calculate how many hours/minuts there is between
> the two clocks, and the result to be showed in a third cell.
>
> How can I do this ?
=ABS(A1-B1)

Signature
--
@+
;o)))
Sandy Mann - 31 May 2008 15:04 GMT
With the first time in A1 and the second time i A2 try:
=MOD(A2-A1,1)
This will work even if the times cross midnight.

Signature
HTH
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk
>I have two cells, each one have a clock in it, like 14:30 and 22:00
> Now I want to calculate how many hours/minuts there is between
> the two clocks, and the result to be showed in a third cell.
>
> How can I do this ?
SpookiePower - 31 May 2008 16:06 GMT
> With the first time in A1 and the second time i A2 try:
>
> =MOD(A2-A1,1)
>
> This will work even if the times cross midnight.
Thanks to all of you, but I can't get it to work.
The only thing that works for me is this -
=A2-A1
But it do not works if the times cross midnight.
I have set the cell format to hh:mm.
Sandy Mann - 31 May 2008 18:16 GMT
I don't know why the MOD() function would not work if both times are XL
times formatted to hh:mm
Try:
=A2-A1+(A2<A1)
which also will cross midnight.

Signature
HTH
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk
>> With the first time in A1 and the second time i A2 try:
>>
[quoted text clipped - 9 lines]
> But it do not works if the times cross midnight.
> I have set the cell format to hh:mm.
SpookiePower - 31 May 2008 19:01 GMT
> Try:
>
> =A2-A1+(A2<A1)
It works, thanks :)
Sandy Mann - 31 May 2008 19:17 GMT
Glad that you got it to work. Thanks for the feedback.

Signature
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk
>> Try:
>>
>> =A2-A1+(A2<A1)
>
> It works, thanks :)