How many hours/minuts between two clocks ?

S

SpookiePower

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 ?
 
M

muddan madhu

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
 
M

Mais qui est Paul

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)
 
S

Sandy Mann

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.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
S

SpookiePower

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.
 
S

Sandy Mann

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.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
S

Sandy Mann

Glad that you got it to work. Thanks for the feedback.

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top