Microsoft Office Tutorials and References
In Depth Information
Examining Some Useful Custom Number Formats
Examining Some Useful Custom Number Formats
This tip provides some useful examples of custom number formats.
See Tip 49 for the steps to enter a custom number format in the Format Cells dialog
box as well as a list of the number format codes.
Hiding zeros
In the following number format string, the third element of the string is empty, which causes
zero-value cells to be displayed as blank:
This format string uses the General format for positive and negative values. You can, of course,
substitute any other format codes.
Displaying leading zeros
To display leading zeros, create a custom number format that uses the 0 character. For example,
if you want all numbers to be displayed with ten digits, use the following number format string;
values with fewer than ten digits are displayed with leading zeros:
In the following example, the format string uses the repeat-character code (an asterisk) to apply
leading zeros to fill the entire width of the cell:
Two zeros are required because the first one represents the character to be repeated, and the
second one represents the value to be displayed.
Formatting percentages
Using a percent symbol (%) in a format string displays the cell in Percentage format. Note that
the percent sign also appears on the formula bar.
The following format string formats values less than or equal to 1 in Percentage format (values
greater than 1 and text are formatted using the General format):
Search JabSto ::

Custom Search