ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Time calculations Urgent please help (https://www.excelbanter.com/excel-worksheet-functions/49373-time-calculations-urgent-please-help.html)

colt

Time calculations Urgent please help
 

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


--
colt

jahoobob


colt Wrote:
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(A1B1,B1-A1+24,B1-A1)


--
jahoobob

jahoobob


colt Wrote:
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(A1B1,((B1-A1)*24)+24,(B1-A1)*24)


--
jahoobob

Sandy Mann

Colt,

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

=B1-A1+(A1B1)

or if you want the answer in real numbers:

=(B1-A1+(A1B1))*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

Replace@mailinator with @tiscali.co.uk
"colt" wrote in message
...

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


--
colt




ruby2sdy

try using the "time" function on your existing numbers



All times are GMT +1. The time now is 09:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com