ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Negative and Positive Time (https://www.excelbanter.com/excel-discussion-misc-queries/110861-negative-positive-time.html)

DazedandConfused

Negative and Positive Time
 
I have a cell in whic the formula may return a positive time or negative time
depending on the hours worked.
I can format the cell to display a positive time or a negative time but not
to switch between the 2.
I have tried formatting the cell to h:mm;(h:mm) and using the 1904 date
system but neither work
HELP!!!!!

Dave O

Negative and Positive Time
 
Most likely you're calculating time based on a timestamp rather than a
datestamp, and if you subtract a PM hour from an AM hour you will get a
negative number (for instance 2 AM - 1 PM = -11, or 2 - 13.. On the
other hand if you use a datestamp that includes a fractional portion of
a day and format the cells to show time only, you can subtract
yesterday's PM time from today's AM time and still get a positive
result.

In a blank cell in a sprdsht enter =NOW() then format that cell as a
number including a comma and several decimal points. 6:30 PM or so
yields 38,980.770. You may want to consult Help to read up on serial
dates.


Bob Phillips

Negative and Positive Time
 
maybe this will help

=MOD(B1-A1,1)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"DazedandConfused" wrote in
message ...
I have a cell in whic the formula may return a positive time or negative

time
depending on the hours worked.
I can format the cell to display a positive time or a negative time but

not
to switch between the 2.
I have tried formatting the cell to h:mm;(h:mm) and using the 1904 date
system but neither work
HELP!!!!!





All times are GMT +1. The time now is 06:12 AM.

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