11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

748<br />

Part VII: Appendixes<br />

The following number format is useful for telephone numbers. Values greater than 9999999 (that<br />

is, numbers with area codes) are displayed as (xxx) xxx-xxxx. Other values (numbers without<br />

area codes) are displayed as xxx-xxxx.<br />

[>9999999](000) 000-0000;000-0000<br />

For U.S. ZIP codes, you might want to use the format string that follows. This displays ZIP codes using<br />

five digits. But if the number is greater than 99999, it uses the ZIP-plus-four format (xxxxx-xxxx).<br />

[>99999]00000-0000;00000<br />

Coloring values<br />

Custom number format strings can display the cell contents in various colors. The following format<br />

string, for example, displays positive numbers in red, negative numbers in green, zero values<br />

in black, and text in blue:<br />

[Red]General;[Green]-General;[Black]General;[Blue]General<br />

Following is another example of a format string that uses colors. Positive values display normally;<br />

negative numbers and text cause Error! to display in red.<br />

General;[Red]”Error!”;0;[Red]”Error!”<br />

Using the following format string, values that are less than 2 display in red. Values greater than 4<br />

display in green. Everything else (text, or values between 2 and 4) displays in black.<br />

[Red][4]General;[Black]General<br />

As seen in the preceding examples, Excel recognizes color names such as [Red] and [Blue]. It<br />

also can use other colors from the color palette, indexed by a number. The following format<br />

string, for example, displays the cell contents using the 16th color in the color palette:<br />

[Color16]General<br />

Excel’s conditional formatting is a much better way to color text in a cell based on the<br />

cell’s value.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!