ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   subtracting hours and minutes (https://www.excelbanter.com/excel-worksheet-functions/28694-subtracting-hours-minutes.html)

Dave

subtracting hours and minutes
 
Hi all,
I have a value in A1 of 300:42 which represents 300 hrs and 42 mins.
B1 contains 50.10 which also represents 50 hrs and 10 mins even though the
separator is a decimal point and not a colon.
What is the best way subtract B1 from A1 to return a value of 250:32?

Thanks in advance
Dave

Peo Sjoblom

One way

=A1-(INT(A2)/24+MOD(A2,1)/14.4)

format result as [hh]:mm:ss

--
Regards,

Peo Sjoblom

(No private emails please)


"Dave" wrote in message
...
Hi all,
I have a value in A1 of 300:42 which represents 300 hrs and 42 mins.
B1 contains 50.10 which also represents 50 hrs and 10 mins even though the
separator is a decimal point and not a colon.
What is the best way subtract B1 from A1 to return a value of 250:32?

Thanks in advance
Dave




All times are GMT +1. The time now is 11:51 AM.

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