19

I'm trying to control the display of Excel cells using the customized format.

For example

#,##0;(#,##0)

will shows positive numbers as usual, but negative numbers with brackets instead of with a - sign.

Where can I find the introduction of the syntax? For example, I don't know how to make negative numbers to show as red. Also, I'm not sure how to specify the precision.

athos
  • 2,371

2 Answers2

20

Try this Microsoft article "Review guidelines for customizing a number format"

A number format can have up to four sections of code, separated by semicolons. These code sections define the format for positive numbers, negative numbers, zero values, and text, in that order.

   <POSITIVE>;<NEGATIVE>;<ZERO>;<TEXT>

For example, you can use these code sections to create the following custom format:

   [Blue]#,##0.00_);[Red](#,##0.00);0.00;"sales "@
teylyn
  • 23,615
4

You can use these Custom formats to put Negative Numbers in Red color, inside Brackets with Minus Sign, and Positive Numbers without Brackets and any Sign in Black Color, (which can be Blue or Even Green also).

[Black]#,##0.00_);[Red](-#,##0.00);0.00

#,##0.00_);[Red](-#,##0.00)

For example:

enter image description here

99,000.00

enter image description here

This Custom Format will show Negative Number with Minus Sing in Black Color without Brackets.

#,##0.00_) -99,000.00

For more details you can check these Web Sites:

https://exceljet.net/custom-number-formats

https://www.ablebits.com/office-addins-blog/2016/07/07/custom-excel-number-format/

Note, Color codes [Black] & [Red] are editable and should like, [Blue] or [Green].

Rajesh Sinha
  • 9,403