Time calculations Urgent please help

C

colt

I am trying to get this result in excel


22:00 to 02:00 =4

22:00 to 03:30 = 5.5

Can anyone help me with this please

Thanks in advance
 
J

jahoobob

colt said:
I am trying to get this result in excel


22:00 to 02:00 =4

22:00 to 03:30 = 5.5

Can anyone help me with this please

Thanks in advance
If 22:00 is in A1 and 2:00 is in B1 then this would work if you format
the cell it is in to a Time format of hh:mm:

=IF(A1>B1,B1-A1+24,B1-A1)
 
J

jahoobob

colt said:
I am trying to get this result in excel


22:00 to 02:00 =4

22:00 to 03:30 = 5.5

Can anyone help me with this please

Thanks in advance
In your illustration, if 22:00 is in A1 and 02:00 is in B1 then this
formula will get your desired reslut:
=IF(A1>B1,((B1-A1)*24)+24,(B1-A1)*24)
 
S

Sandy Mann

Colt,

With 22:00 in A1 and 02:00 in B1, try:

=B1-A1+(A1>B1)

or if you want the answer in real numbers:

=(B1-A1+(A1>B1))*24

and format the cell as General or Number

An alternative would be:

=MOD(B1-A1,1) for time

or

=MOD(B1-A1,1)*24

for a General number


--
HTH

Sandy
[email protected]
Replace@mailinator with @tiscali.co.uk
 
Top