18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Part IV<br />

Using Advanced Excel Features<br />

Preformatting Cells<br />

Usually, you’ll apply number formats to cells that already contain values. You also can format cells with a<br />

specific number format before you make an entry. Then, when you enter information, it takes on the format<br />

that you specified. You can preformat specific cells, entire rows or columns, or even the entire worksheet.<br />

Rather than preformat an entire worksheet, however, you can change the number format for the Normal style.<br />

(Unless you specify otherwise, all cells use the Normal style.) Change the Normal style by displaying the Style<br />

gallery. Choose Home ➪ Styles. Right-click the Normal style icon and choose Modify to display the Style dialog<br />

box. In the Style dialog box, click the Format button and then choose the new number format that you<br />

want to use for the Normal style.<br />

If you want to apply cell formatting automatically (such as text or background color) based on<br />

the cell’s contents, a much better solution is to use Excel’s Conditional Formatting feature.<br />

Chapter 21 covers conditional formatting.<br />

CROSS-REF<br />

Custom number format codes<br />

Table 24.3 lists the formatting codes available for custom formats, along with brief descriptions. I use most<br />

of these codes in examples later in this chapter.<br />

TABLE 24.3<br />

Code<br />

Codes Used to Create Custom Number Formats<br />

Comments<br />

General<br />

Displays the number in General format.<br />

# Digit placeholder. Displays only significant digits, and does not display insignificant zeros.<br />

0 (zero) Digit placeholder. Displays insignificant zeros if a number has fewer digits than there are zeros<br />

in the format.<br />

? Digit placeholder. Adds spaces for insignificant zeros on either side of the decimal point so<br />

that decimal points align when formatted with a fixed-width font. You can also use ? for<br />

fractions that have varying numbers of digits.<br />

. Decimal point.<br />

% Percentage.<br />

, Thousands separator.<br />

E- E+ e- e+ Scientific notation<br />

$ - + / ( ) : space Displays this character.<br />

\ Displays the next character in the format.<br />

* Repeats the next character, to fill the column width.<br />

470

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

Saved successfully!

Ooh no, something went wrong!