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 />

Displaying text with numbers<br />

The ability to display text with a value is one of the most useful benefits of using a custom number format.<br />

To add text, just create the number format string as usual (or use a built-in number format as a starting<br />

point) and put the text within quotation marks. The following number format string, for example, displays<br />

a value with the text (US Dollars) added to the end:<br />

#,##0.00 “(US Dollars)”<br />

Here’s another example that displays text before the number:<br />

“Average: “0.00<br />

If you use the preceding number format, you’ll find that the negative sign appears before the text for negative<br />

values. To display number signs properly, use this variation:<br />

“Average: “0.00;”Average: “-0.00<br />

The following format string displays a value with the words Dollars and Cents. For example, the number<br />

123.45 displays as 123 Dollars and .45 Cents.<br />

0 “Dollars and” .00 “Cents”<br />

Suppressing certain types of entries<br />

You can use number formatting to hide certain types of entries. For example, the following format string<br />

displays text but not values:<br />

;;<br />

This format string displays values but not text or zeros:<br />

0.0;-0.0;;<br />

This format string displays everything except zeros:<br />

0.0;-0.0;;@<br />

Formatting Numbers by Using the TEXT Function<br />

Excel’s TEXT function accepts a number format string as its second argument. For example, the following<br />

formula displays the contents of cell A1 using a custom number format that displays a fraction:<br />

=TEXT(A1,”# ??/50”)<br />

However, not all formatting codes work when used in this manner. For example, colors and repeating characters<br />

are ignored. The following formula does not display the contents of cell A1 in red:<br />

=TEXT(A1,”[Red]General”)<br />

478

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

Saved successfully!

Ooh no, something went wrong!