ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I subtract time? (https://www.excelbanter.com/excel-worksheet-functions/106002-how-do-i-subtract-time.html)

Fletch74

How do I subtract time?
 
I read that you can do (B1-A1)*24 but for the values where A is in PM and B
is in AM this returns a negative hour much larger than what it should be.
Any recommendations? Thanks.

Domenic

How do I subtract time?
 
Try...

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

Hope this helps!

In article ,
Fletch74 wrote:

I read that you can do (B1-A1)*24 but for the values where A is in PM and B
is in AM this returns a negative hour much larger than what it should be.
Any recommendations? Thanks.


Toppers

How do I subtract time?
 
Try:

=MOD((B1-A1),1)*24

"Domenic" wrote:

Try...

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

Hope this helps!

In article ,
Fletch74 wrote:

I read that you can do (B1-A1)*24 but for the values where A is in PM and B
is in AM this returns a negative hour much larger than what it should be.
Any recommendations? Thanks.



Fletch74

How do I subtract time?
 
Thanks, both work. =D

"Toppers" wrote:

Try:

=MOD((B1-A1),1)*24

"Domenic" wrote:

Try...

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

Hope this helps!

In article ,
Fletch74 wrote:

I read that you can do (B1-A1)*24 but for the values where A is in PM and B
is in AM this returns a negative hour much larger than what it should be.
Any recommendations? Thanks.




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

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