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] |
Contents
Example 1:
In this example, the font color of the cell is changed to red:
[Red]0
Result:
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:
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:
You can download the file related to this article from the link below
See also:
- Excel, Custom Formatting Semicolon Character
- Excel Custom Formatting Conditions
- Excel, Custom Formats
- Excel Custom Formatting, 0, # and ? characters
- Excel Custom Formatting Adding Characters and Text
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