#1   Report Post  
B. Baumgartner
 
Posts: n/a
Default Negative Time Values


I have a cell into which I would like to input a time value, either
negative or positive from which other cells will perform calculations.

When I enter the time as a positive value it works fine, however if I
attempt to put the value in as a negative, i get a popup that says "The
formula you typed contains an error. If you are not trying to enter a
formula avoid using the - sign."

If I format the cell as -h:mm, it has no problem processing the value
entered, however I cannot enter a positive value. This same error
occurs no matter how the cell is format, from General, to Number, to
Time, to Custom Time.

I have the 1904 date system enabled if that helps with the problem
solving.


--
B. Baumgartner
------------------------------------------------------------------------
B. Baumgartner's Profile: http://www.excelforum.com/member.php...o&userid=23107
View this thread: http://www.excelforum.com/showthread...hreadid=383776

  #2   Report Post  
Harald Staff
 
Posts: n/a
Default

There is no easy userfriendly way to enter negative time. This will work:
-"04:00"
and this
=-TIME(4,0,)

Formatting as -h:mm will just display a - in front of the positive number.
Formatting does NOT change value, so the cell will still contain a positive
number.

I'd use a small macro that change sign in the selected cell(s):

Sub ChangeSign()
Dim Cel As Range
On Error Resume Next
For Each Cel In Intersect(Selection, ActiveSheet.UsedRange)
If Cel.HasFormula = False Then Cel.Value = -Cel.Value
Next
End Sub

HTH. Best wishes Harald

"B. Baumgartner"
skrev i melding
news:B.Baumgartner.1rgxia_1120183505.8262@excelfor um-nospam.com...

I have a cell into which I would like to input a time value, either
negative or positive from which other cells will perform calculations.

When I enter the time as a positive value it works fine, however if I
attempt to put the value in as a negative, i get a popup that says "The
formula you typed contains an error. If you are not trying to enter a
formula avoid using the - sign."

If I format the cell as -h:mm, it has no problem processing the value
entered, however I cannot enter a positive value. This same error
occurs no matter how the cell is format, from General, to Number, to
Time, to Custom Time.

I have the 1904 date system enabled if that helps with the problem
solving.


--
B. Baumgartner
------------------------------------------------------------------------
B. Baumgartner's Profile:

http://www.excelforum.com/member.php...o&userid=23107
View this thread: http://www.excelforum.com/showthread...hreadid=383776



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zero values in a log chart Joelle_Smith Charts and Charting in Excel 2 May 8th 23 03:42 AM
how to use time format to present negative value? ex. -00:42 min hass Excel Discussion (Misc queries) 4 April 19th 05 06:04 AM
recording negative time james Excel Discussion (Misc queries) 3 April 15th 05 12:20 PM
Calculating negative time. Brian Excel Discussion (Misc queries) 4 April 7th 05 08:37 PM
negative time joshua Excel Discussion (Misc queries) 1 January 6th 05 06:41 PM


All times are GMT +1. The time now is 09:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"