ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   subtracting time going backwards past midnight? (https://www.excelbanter.com/excel-worksheet-functions/179319-subtracting-time-going-backwards-past-midnight.html)

Billman

subtracting time going backwards past midnight?
 
I am trying to track time going backwards. In other words I am backing into a
start time. I am having problems when I cross midnight going backwards.

T. Valko

subtracting time going backwards past midnight?
 
Try this:

A1 = 7:00 PM
B1 = 3:00 AM

=MOD(B1-A1,1)

Format as h:mm = 8:00

Or, if you want the result in decimal format:

=MOD(B1-A1,1)*24

Format as GENERAL or NUMBER = 8


--
Biff
Microsoft Excel MVP


"Billman" wrote in message
...
I am trying to track time going backwards. In other words I am backing into
a
start time. I am having problems when I cross midnight going backwards.




Tyro[_2_]

subtracting time going backwards past midnight?
 
You will have a problem there. Excel maintains times as fractions of 24
hours. To keep accurate time, you must also take date into account.
as Excel maintains time and dates as date.time That is to say, the date is
maintained as a whole number and the time as a fraction.

Tyro
"Billman" wrote in message
...
I am trying to track time going backwards. In other words I am backing into
a
start time. I am having problems when I cross midnight going backwards.




Teethless mama

subtracting time going backwards past midnight?
 
=B1-A1+(A1B1)

Fomat cell as h:mm


"Billman" wrote:

I am trying to track time going backwards. In other words I am backing into a
start time. I am having problems when I cross midnight going backwards.



All times are GMT +1. The time now is 01:14 AM.

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