Excel, Custom Formatting Colors

Using custom formatting you can change the cell font color. For example you could use a custom formatting that colors negative numbers red, or numbers larger than a certain amount blue. There are 8 different colors where you can choose from:

[Black]
[Green]
[White]
[Blue]
[Magenta]
[Yellow]
[Cyan]
[Red]

 


Example 1:

In this example, the font color of the cell is changed to red:

[Red]0

Result:

Excel Custom Formatting, Colors, Example 1


Example 2:

In this example only negative numbers will be colored red:

0;[Red]-0

The formatting before the semicolon character applies to positive numbers and the formatting after the semicolon character applies to negative numbers. For more information about the semicolon character please see the link below:

Result:

Excel Custom Formatting, Colors, Example 2


Example 3:

In this example if the number in the cell is larger than 2000 it is colored red, if it is smaller than 100 it is colored blue:

[Red][>2000]0;[Blue][<100]0;0

The part before the first semicolon checks if the number is larger than 2000. If the it returns true then the number is printed in red. The part after the first semicolon checks if the number is smaller than 100, if it returns true then the number is printed in blue. If both conditions fail the last part prints the semicolon as it is.

For more information about using conditions in custom formatting please see the article below:

Result:

Excel Custom Formatting, Colors, Example 3

You can download the file related to this article from the link below

See also:

If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website  www.software-solutions-online.com

Leave a Reply

Your email address will not be published. Required fields are marked *