parenthesis for negative numbers

J

jr

how do I get the negative numbers to appear in parens instead of the negative
sign in front of it?
 
J

Jay Freedman

jr said:
how do I get the negative numbers to appear in parens instead of the
negative sign in front of it?

Use a numeric picture switch in the formula or sum field, as shown in
http://www.gmayor.com/formatting_word_fields.htm#basic_switch.

For example, if the numbers in the table column are decimals with two
digits, the field would look like

{ =SUM(ABOVE) \#"0.00; (0.00)" }


--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
H

Herb Tyson [MVP]

Delete the minus sign and press Shift+9 before the number and Shift+0 after
the number.

Or... did you mean automatically? If you mean automatically, Word does not
have the ability to format numbers in that way--for that, you could use
Excel. One way would be to embed an Excel worksheet inside Word to use as
the basis for your table. That way you would have all of Excel's
capabilities when editing and formatting the table.

--

Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com
 
H

Herb Tyson [MVP]

I said:
Or... did you mean automatically? If you mean automatically, Word does not
have the ability to format numbers in that way...

Except using field codes, as Jay points out. However, unless you're already
using a field, enshrining your numbers in a { = } field seems like a lot
more work than just adding your own parentheses. It could also be done using
Find/Replace--with or without difficulty depending on whether the numbers
contains commas. Assuming they don't and numbers don't have more than 10
digits, select the table, row, or column of interest, and use:

Find what:-([0-9]{1,10}) (and enable Use wildcards)
Replace with:(\1)

Add the desired currency symbol as needed if you're dealing with money.

You could commit the Find/Replace to a macro and assign it to a
key/button/etc. so that you could simply apply it to a table that's
populated with numbers that need to be ()'ed.

If the numbers contain commas, a more complex specification might be able to
find them, but it's probably not worth the brain strain unless they do.

All in all... I'd use an Excel table if I needed (9) instead of -9 and had a
lot of instances.

--

Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top