ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Subtracting times (https://www.excelbanter.com/excel-discussion-misc-queries/3610-subtracting-times.html)

[email protected]

Subtracting times
 
Hi all,

What formula can I use to subtract 2 times so that I get the number of
minutes the one time is either ahead or behind the other. For example,
if the deadline time is 08:00 and the actual time is 8:30, I want a
result of -30 or even better, -00:30. It works fine the other way,
where the actual time is before the deadline time.

Many thanks.

Rob


Bob Phillips

Rob,

If it is okay to have the result as a text string, that is you don't want to
use it for math, then you can use

=IF(A1<B1,"-","")&TEXT(ABS(A1-B1),"hh:mm")

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
Hi all,

What formula can I use to subtract 2 times so that I get the number of
minutes the one time is either ahead or behind the other. For example,
if the deadline time is 08:00 and the actual time is 8:30, I want a
result of -30 or even better, -00:30. It works fine the other way,
where the actual time is before the deadline time.

Many thanks.

Rob





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

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