Cell Properties > Number Tab > Custom Type -0;
Main Topics
Browse All TopicsHi,
I wish to format a series of cells so that everytime I key in a number it will show as a negative number. So for example, if I key in a 5 it will show up as -5. I tried to put the fomula in as:
=*(-1) but keep getting an error message.
How can I accomplish this simple task? Thanks in advance:)
njb
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
Thanks for such quick responses. Your solutions worked but I think I now have another problem, which is that when the cell is added to an adjacent cell, it does not give the proper result. So for example if I format column B to have negative numbers when I key in a positive one:
A B C
1 5 -3 8
2
3
If column C is =SUM(A1:B1), then I would like to have the result be 2 instead of 8. Is this possible, or do I have to key the -3 in longhand?
I have increased the points accordingly.
njb,
If you want a real negative number, then you will either need to use two cells (one for formula, the other for input)--or you could use a VBA sub for the purpose. Here is one that must be installed in the code pane for the worksheet you are entering data into. It watches cells A1:A5, A10:A15 and A20:A25 for inputs; any positive number is turned to a negative. Negative numbers, 0 and text are left alone.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim targ As Range, cel As Range
'Enter a positive number in these cells, it will be converted to a negative number
Set targ = Union([A1:A5], [A10:A15], [A20:A30]) 'Change range to suit
Set targ = Intersect(Target, targ)
If targ Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each cel In targ.Cells
If IsNumeric(cel) Then cel = -Abs(cel)
Next
Application.EnableEvents = True
End Sub
To install a sub in the code pane for a worksheet:
1) Right-click the sheet tab for the worksheet
2) Choose View Code from the resulting pop-up
3) Paste the suggested code in the resulting module sheet
4) ALT + F11 to return to the worksheet
If the above procedure doesn't work, then you need to change your macro security setting. To do so, open the Tools...Macro...Security menu item. Choose Medium, then click OK.
Brad
Business Accounts
Answer for Membership
by: byundtPosted on 2006-03-07 at 14:33:29ID: 16128446
Hi njb,
Try using Custom cell format
-#;-#;-0;@
Cheers!
Brad