OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Solved] Want to display negative numbers in parentheses

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
Valacapt
General User
General User


Joined: 29 Oct 2011
Posts: 18
Location: Seattle, WA

PostPosted: Sun Oct 30, 2011 1:19 pm    Post subject: [Solved] Want to display negative numbers in parentheses Reply with quote

I have looked all over, have the book, and I cannot find how to switch from a minus sign to parentheses for negative numbers. The practice is so prevalent that I cannot believe it is not an option. Will anyone give me a hand with this? Thanks.

Last edited by Valacapt on Tue Nov 08, 2011 4:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
peterroots
Super User
Super User


Joined: 01 Nov 2006
Posts: 591
Location: United Kingdom

PostPosted: Sun Oct 30, 2011 1:35 pm    Post subject: Reply with quote

Fromat>cells>Numbers
Number (under the category heading)
(1,2345) or (1,1234.12) as appropriate to your needs under the format heading

More explanations under Help>format codes>numbers
_________________
Kubuntu 11.10 LibreOffice3.4.4
Back to top
View user's profile Send private message
Valacapt
General User
General User


Joined: 29 Oct 2011
Posts: 18
Location: Seattle, WA

PostPosted: Sun Oct 30, 2011 5:12 pm    Post subject: [Solved] Want to display negative numbers in parentheses Reply with quote

Thank you for your reply. Using "Format Cells" or Format>Cells I can get to the setting of negative numbers as red, and I see the formatting codes and how they are employed, but nowhere do I see the ability to use parentheses instead of a "-" for a negative number nor instructions on how to do it using the format code. That surprises because every other spreadsheet I've used allowed that as a common alternative.

That said, I went ahead after starting this and was able to remove the "-" and make it do parentheses using the following code: [$$-409]#,##0.00;[RED]([$$-409]#,##0.00)

This is probably old hat to skilled users, but naive users like me need a bit more help. Thank you for getting me off dead center.


Last edited by Valacapt on Mon Nov 07, 2011 10:56 am; edited 1 time in total
Back to top
View user's profile Send private message
ken johnson
Super User
Super User


Joined: 23 Apr 2009
Posts: 2032
Location: Sydney, Australia

PostPosted: Sun Oct 30, 2011 6:51 pm    Post subject: Re: Want to display negative numbers in parentheses Reply with quote

Valacapt wrote:
...but nowhere do I see the ability to use parentheses instead of a "-" for a negative number nor instructions on how to do it using the format code.

This format code replaces the negative sign with parentheses...

General;(General)

The portion of the format code left of the semicolon defines the format for positive values, which includes zero.
The portion of the format code right of the semicolon defines the format for negative values.

If the format code contains two semicolons, eg...

General;(General);<General>

the portion left of the first semicolon defines the format for positive values, the portion right of the first semicolon defines the format for negative values and the portion right of the second semicolon defines the format for zero values.

A third semicolon can be added for defining the format for text values.
For example...

General;(General);<General>;[MAGENTA]@

will result in magenta font colour for text, zero as <0>, -1 as (1) and 1 as normal.

Ken Johnson
_________________
If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button).
Back to top
View user's profile Send private message
peterroots
Super User
Super User


Joined: 01 Nov 2006
Posts: 591
Location: United Kingdom

PostPosted: Mon Oct 31, 2011 10:24 am    Post subject: Reply with quote

under number I have 8 different formats listed (1,234) and (1,234.12) are the last two and are the ones that give you negative numbers. these translate to #,##0_);(#,##0) and #,##0.00_);(#,##0.00) respectively as format codes
_________________
Kubuntu 11.10 LibreOffice3.4.4
Back to top
View user's profile Send private message
Valacapt
General User
General User


Joined: 29 Oct 2011
Posts: 18
Location: Seattle, WA

PostPosted: Tue Nov 08, 2011 5:11 pm    Post subject: Reply with quote

peterroots wrote:
under number I have 8 different formats listed (1,234) and (1,234.12) are the last two and are the ones that give you negative numbers. these translate to #,##0_);(#,##0) and #,##0.00_);(#,##0.00) respectively as format codes


Thank you both. peterroots' function code did not work and when I went back to Format Cells the code had been removed.
My own "dumb luck" version: [$$-409]#,##0.00;[RED]([$$-409]#,##0.00) did work. I tried changing different things. If you have time would you review your code and let me know how it turns out? Helpful for understanding these codes.
Back to top
View user's profile Send private message
peterroots
Super User
Super User


Joined: 01 Nov 2006
Posts: 591
Location: United Kingdom

PostPosted: Wed Nov 09, 2011 6:27 am    Post subject: Reply with quote

my code was just what is in my default install of LO - I copied and pasted it straight out of the settings
_________________
Kubuntu 11.10 LibreOffice3.4.4
Back to top
View user's profile Send private message
Valacapt
General User
General User


Joined: 29 Oct 2011
Posts: 18
Location: Seattle, WA

PostPosted: Wed Nov 09, 2011 10:21 am    Post subject: Reply with quote

peterroots wrote:
my code was just what is in my default install of LO - I copied and pasted it straight out of the settings

OK - I'll keep trying and, it is hoped, keep learning.

Last request: What is the $$-409 statement about?
Back to top
View user's profile Send private message
gerard24
OOo Enthusiast
OOo Enthusiast


Joined: 08 Jul 2011
Posts: 100
Location: France

PostPosted: Wed Nov 09, 2011 11:19 am    Post subject: Reply with quote

Valacapt wrote:

Last request: What is the $$-409 statement about?

Your format is a currency format. $$-409 is the code for US Dollar.
French Euro is $€-40C
_________________
LibreOffice 3.5.0 on Windows Vista
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group