18.11.2014 Views

Microsoft Office

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

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

Using Custom Number Formats 24<br />

Adding zeros to a value<br />

The following format string displays a value with three additional zeros and no decimal places. A value with<br />

this number format appears as if it’s rounded to no decimal places and then multiplied by 1,000.<br />

#”,000”<br />

Examples of this format string, plus a variation that adds six zeros, are shown in Table 24.8.<br />

TABLE 24.8<br />

Examples of Displaying a Value with Extra Zeros<br />

Value Number Format Display<br />

1 #”,000” 1,000<br />

1.5 #”,000” 2,000<br />

43 #”,000” 43,000<br />

–54 #”,000” –54,000<br />

5.5 #”,000” 6,000<br />

0.5 #”,000,000” 1,000,000<br />

0 #”,000,000” ,000,000<br />

1 #”,000,000” 1,000,000<br />

1.5 #”,000,000” 2,000,000<br />

43 #”,000,000” 43,000,000<br />

–54 #”,000,000” –54,000,000<br />

5.5 #”,000,000” 6,000,000<br />

0.5 #”,000,000” 1,000,000<br />

Displaying leading zeros<br />

To display leading zeros, create a custom number format that uses the 0 character. For example, if you want<br />

all numbers to display with ten digits, use the number format string that follows. Values with fewer than ten<br />

digits will display with leading zeros.<br />

0000000000<br />

You also can force all numbers to display with a fixed number of leading zeros. The format string that follows,<br />

for example, appends three zeros to the beginning of each number:<br />

“000”#<br />

In the following example, the format string uses the repeat character code (an asterisk) to apply enough<br />

leading zeros to fill the entire width of the cell:<br />

*00<br />

475

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

Saved successfully!

Ooh no, something went wrong!