Microsoft KB Archive/922069

= Information about the settings in the &quot;Format Cells&quot; dialog box in Excel 2007 =

Article ID: 922069

Article Last Modified on 10/15/2007

-

APPLIES TO


 * Microsoft Office Excel 2007

-



INTRODUCTION
Microsoft Office Excel 2007 lets you change many of the ways that it displays data in a cell. For example, you can specify the number of digits to the right of a decimal point. You can also add a pattern and a border to the cell. You can access and modify most of these settings in the Format Cells dialog box. To access the Format Cells dialog box, click the Format Cells Dialog Box Launcher in the Font group on the Home tab.

This article contains information about each setting that is available in the Format Cells dialog box. Additionally, this article describes how each setting affects the way that your data is presented in Excel 2007.



MORE INFORMATION
The Format Cells dialog box contains the following tabs:
 * Number
 * Alignment
 * Font
 * Border
 * Fill
 * Protection

The following sections describe the settings that are available on each tab.

Automatic number formatting
By default, all worksheet cells are formatted with the General number format. With the General number format, anything that you type in the cell is usually left as-is. For example, if you type 36526 in a cell and then press ENTER, the cell contents are displayed as 36526. This behavior occurs because the cell remains in the General number format. However, if you first format the cell as a date, for example, d/d/yyyy, and then type 36526, the cell displays 1/1/2000.

Excel 2007 leaves the General number format in other situations. However, the cell contents are not displayed exactly as they are typed. For example, if you have a narrow column, and you type a long string of digits such as 123456789, the cell might instead display something that resembles 1.2E+08. If you check the number format in this situation, the format remains the General number format.

Finally, there are scenarios in which Excel 2007 may automatically change the General number format to another format, based on the characters that you type in the cell. This feature saves you from manually making the easily recognized number format changes. The following table outlines some examples of when this behavior can occur.

Typically, Excel 2007 applies automatic number formatting whenever you type the following types of data in a cell:
 * Currency
 * Percentage
 * Date
 * Time
 * Fraction
 * Scientific

Built-in number formats
Excel 2007 has many built-in number formats from which you can choose. To use one of these formats, click any one of the categories under General. Then, click the option that you want for that format. When you click a format in the list, Excel 2007 automatically displays an example of the output in the Sample box on the Number tab. For example, if you type 1.23 in the cell, and you click Number in the category list and then set Decimal places to 3, 1.230 is displayed in the cell.

These built-in number formats use a predefined combination of the symbols that are listed in the &quot;Custom number formats&quot; section. However, the underlying custom number format is transparent to you.

The following table lists the available built-in number formats.

Custom number formats
If one of the built-in number formats does not display the data in the format that you require, you can create a custom number format. To do this, modify the built-in formats. Alternatively, combine the formatting symbols into your own combination.

Before you create your own custom number format, be aware of the following rules that govern the syntax for number formats:   Each format that you create can have up to three sections for numbers and a fourth section for text. ;;;  The first section is the format for positive numbers. The second section is the format for negative numbers. The third section is the format for zero values. These sections are separated by semicolons. If you have only one section, all numbers (positive, negative, and zero) are formatted by using that format. You can prevent any number type (positive, negative, and zero) from being displayed by not typing symbols in the corresponding section. For example, the number format 0.00;; prevents any negative or zero values from being displayed.</li> To set the color for any section in the custom format, type the name of the color in brackets in the section. For example, the number format [BLUE]#,##0;[RED]#,##0 formats positive numbers as blue and negative numbers as red.</li> Instead of the default positive, negative, and zero sections in the number format, you can specify custom criteria that must be met for each section. The conditional statements that you specify must be enclosed in brackets. For example, the number format [>100][GREEN]#,##0;[<=-100][YELLOW]#,##0;[CYAN]#,##0 formats all numbers that are greater than 100 as green, all numbers that are less than or equal to -100 as yellow, and all other numbers as cyan.</li> For each part of the format, type symbols that represent how you want the number to look. See the following table for information about the available symbols.</li></ul>

To create a custom number format, click Custom in the Category list. The Category list is located on the Number tab in the Format Cells dialog box. Then, type your custom number format in the Type box.

The following table describes the different symbols that are available for use in custom number formats.

Displayed value versus stored value
Excel 2007 displays a number according to the format of the cell that contains the number. Therefore, the number that you see in the cell may differ from the number that is stored by Excel 2007 and from the number that is used in calculations that refer to the cell. For example, if you type 1.2345 in a cell in which you want only two digits to be displayed to the right of the decimal, the cell displays the value 1.23. However, if you use that cell in a calculation, all four digits to the right of the decimal are used. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

181918 Number formatting affects perceived precision in Excel for Mac

The Alignment tab
You can position text and numbers, change the orientation, and specify text control in cells by using the settings on the Alignment tab in the Format Cells dialog box.

Text alignment
Under Text alignment, you control the horizontal alignment, the vertical alignment, and the indention of the text in a cell. The following table lists the settings that are available for text alignment.

Text control
There are some additional miscellaneous text alignment controls in the Text Control section of the Alignment tab. These controls are Wrap Text, Shrink to Fit and Merge Cells.

Use Wrap Text to wrap the text in the selected cell. The number of wrapped lines depends on the width of the column and on the length of the cell contents.

Note To start a new line when you use the Wrap Text option, press ALT+ENTER while you type in the formula bar.

Use Shrink to Fit to decrease the font size of the text in a cell until all the contents of the cell can be displayed. This feature helps when you want to avoid changing the column width for the whole column. The applied font size is not changed.

Use Merge Cells to combine two or more selected cells into a single cell. A merged cell is a single cell that is created by combining two or more selected cells. The cell reference for a merged cell is the upper-left cell in the original selected range.

Orientation
You can set the text rotation in the selected cell in the Orientation section. Use a positive number in the Degree box to rotate the selected text from lower-left to upper-right in the selected cell. Use negative degrees to rotate text from upper-left to lower-right in the selected cell.

To display text vertically from top to bottom, click Text under Orientation. This gives a stacked appearance to text, numbers, and formulas in the cell.

Right-to-left
To have text read from right-to-left in a cell, click Right-to-left in the Text direction list.

To have text read from left-to-tight in a cell, click Left-to-right in the Text direction list.

To have the text direction determined contextually, click Context in the Text direction list.

The Font tab
The term &quot;font&quot; refers to a typeface (for example, Arial) together with the attributes of the typeface (point size, font style, underlining, color, and effects). Use the settings on the Font tab in the Format Cells dialog box to control these settings. You can see a preview of your settings by viewing the Preview section of the dialog box.

Note You can use the settings on the Font tab to format individual characters. To do this, select the characters in the formula bar, and then click the Format Cells Dialog Box Lanchaer in the Font group on the Home tab.

Font, font style, and font size
The Font option on the Font tab lets you choose a font. To choose the font for the selected cell, click a name in the Font list. Alternatively, type a name in the Font box. There are three types of fonts that you can use. These types are described in the following table.

After you select a font in the Font list, the Size list displays the available point sizes. You can also type the font size that you want to use. Each point is approximately 1/72 of an inch.

Font styles
The choices that are available in the Font Style list vary depending on the font that is selected in the Font list. Most fonts include the following styles:
 * Regular
 * Italic
 * Bold
 * Bold italic

Underline
In the Underline list, you can select an underlining option to format the selected text. The following table describes each underlining option.

Color, effects, and normal font settings
To choose a color for the font, click a color in the Color list. You can rest the mouse pointer over a color to see a ToolTip that contains the name of the color. The Automatic color is always black unless you change the font color on the Appearance tab of the Display Properties dialog box. To open the Display Properties dialog box, double-click the Display icon in Control Panel.

Click to select the Normal font check box to set the font, font style, size, and effects to the normal style. This resets the cell formatting to the default formatting.

Click to select the Strikethrough check box to draw a line through the selected text or numbers. Click to select the Superscript check box to format the selected text or numbers as superscripts. Click to select the Subscript check box to format the selected text or numbers as subscripts. Typically, you may want to use subscripts and superscripts for individual characters in a cell. To do this, select the characters in the formula bar, and then click the Format Cells Dialog Box Lanchaer in the Font group on the Home tab.

The Border tab
In Excel 2007, you can put a border around a single cell or around a range of cells. You can also have a line drawn from the upper-left corner of the cell to the lower-right corner or from the lower-left corner of the cell to the upper-right corner.

To customize the borders of these cells from their default settings, change the line style, the line thickness, or the line color.

The following settings are available on the Border tab of the Format Cells dialog box.

How to apply borders
To add a border to a single cell or to a range of cells, follow these steps:
 * 1) Select the cells that you want to format.
 * 2) On the Home tab, click the Format Cells Dialog Box Lanchaer in the Font group.
 * 3) In the Format Cells dialog box, click the Border tab.

Note Some buttons on the Border tab are unavailable (dimmed) when only a single cell is selected. This behavior occurs because these settings are only applicable when you apply borders to a range of cells.
 * 1) Click any one of the line styles in the Style list.
 * 2) Click the Color arrow, and then click any one of the colors.
 * 3) Click any one of buttons that are listed under Presets or Border. This displays a line with your settings in the sample region.
 * 4) If you want to remove a specific border, click the button for that border again.
 * 5) If you want to change the line color or style, click the style or color that you want, and then click the button for the border again.

The Fill tab
Use the settings on the Fill tab to set the background color of the selected cells. You can also use the Pattern Color and the Pattern Style lists to apply two-color patterns or shading for the background of the cell. Fill Effects lets you apply a gradient fill to the background of the cell.

To shade cells with patterns, follow these steps:
 * 1) Select the cells that you want to shade.
 * 2) Right-click within the range of cells that you have selected, and then click Format Cells.
 * 3) On the Fill tab, click a color in the Background Color palette to include a background color for the pattern.
 * 4) Click a color in the Pattern Color list, and then click the pattern style that you want from the Pattern Style list.

If you do not select a pattern color, the pattern is black.

To select a custom color, click More Colors, and then select a color from either the Standard tab or the Custom tab.

To return the background color formatting for the selected cells to the default state, click No Color.

The Protection tab
The Protection tab provides the following settings that you can use to protect your worksheet data and formulas:
 * Locked
 * Hidden

However, neither of these options takes effect unless you also protect your worksheet. To protect a worksheet, on the Review tab, click Protect Sheetin the Changes group.

Locked
By default, all cells in a worksheet have the Locked option enabled. When this option is enabled and the worksheet is protected, you cannot do the following:
 * Change the cell data or formulas.
 * Type data in an empty cell.
 * Move the cell.
 * Resize the cell.
 * Delete the cell or its contents.

Note If you want to be able to type data in some cells after you protect the worksheet, make sure that you click to clear the Locked check box for those cells.

Hidden
By default, all cells in a worksheet have the Hidden option disabled. If you enable this option when the worksheet is protected, the formula in a cell does not appear in the formula bar. However, you do see the results of the formula in the cell.

Important The Locked and Hidden settings enable specific collaboration scenarios to function correctly in collaboration environments that do not include users who have malicious intent. You cannot enable a strong encryption file by using these settings.

To protect the document or the file from a user who has malicious intent, use Information Rights Management (IRM) to set permissions that will protect the document or the file.

For more information about the Office features that help enable collaboration, click the following article number to view the article in the Microsoft Knowledge Base:

822924 Description of Office features that are intended to enable collaboration and that are not intended to increase security

For more information about how to restrict permissions to content by using IRM, visit the following Microsoft Web site:

http://office.microsoft.com/en-us/help/HA101029181033.aspx

Keywords: kbhowto kbinfo kbformat kbexpertisebeginner KB922069

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.