The accounting format in Microsoft Excel 2010 is very similar to the currency format---both display the currency symbol next to every number. '()' indicates cell is formatted with parentheses for positive or all values. In the following example spreadsheet, the Excel Cell function is used to return different properties of the cell A1. It should be noted that, in the spreadsheet, cell A1 is formatted with the Custom Format #,##0; [Red] - #,##0.
Working with accountants, one of the requirements I often get asked for, is to show negative numbers in brackets. Surprisingly, this is not one of the standard number formats in Excel, not even if you choose the Accounting format! Fortunately, however, this can be remedied using a custom number format.
It is usually easier to start with a format that is close to what you want. We will start with the Accounting format, to 2 decimal places, and no currency symbol.
To select this, right-click the cell, choose Format Cells and, on the Number Format tab, selecting Accounting. In the information to the right, select 2 decimal places and None (for the currency symbol). Click OK to store this as the number format for that cell (or the range of cells selected). Now follow the same sequence again, but this time choose Custom as the Number Format. You will see the code for the existing format (as previously selected) in the box at the top of the section on the right: -.
#,##0.00-;-. #,##0.00-;-. '-'??-;-@- We will edit this code to give us our brackets. The first thing that we need to be aware of is the different sections of the code.
This format uses the maximum four sections, each section being separated by semicolons. The sections are as follows:. Positive Numbers.
Negative Numbers. Zero. Text. Glen- Very valid point - brackets are much easier to spot than minus signs ('-').
But my version of Excel (2008) DOES have the option of using brackets for negative numbers, in the 'Accounting' and 'Currency' format choices. No need for a lot of custom formatting. By the way, I for one disagree strongly with the notion of putting negative numbers in red in most cases. Red is a powerful distinguisher, and why should a tiny, irrelevant negative number get more attention than a very significant positive one?
If you want to use colors to distinguish numbers, better to use Conditional Formatting. Randall Bolten, 'Painting with Numbers'. I aim to provide practical Excel tips to those using Excel in their day-to-day jobs. I am a Chartered Accountant who has used Excel for too many years to remember, and now focus my efforts on helping others to get the most out of this powerful tool. If you have any Excel requirements, I provide both on-site and remote consultancy and development services, of which you can find out more.
You can sign up (below) and get a free report and regular updates of new posts to the blog. Also have a look at the section for free training videos, etc. I hope you find the content useful and that every now and again it makes you smile. Glen Feechan.
Formatting Numbers, Dates, and Times One of the best ways to improve the readability of your worksheets is to display your data in a format that is logical, consistent, and straightforward. Formatting currency amounts with leading dollar signs, percentages with trailing percent signs, and large numbers with commas are a few of the ways you can improve your spreadsheet style. This section shows you how to format numbers, dates, and times using Excel’s built-in formatting options. You’ll also learn how to create your own formats to gain maximum control over the appearance of your data. Numeric Display Formats When you enter numbers in a worksheet, Excel removes any leading or trailing zeros.
For example, if you enter 0123.4500, Excel displays 123.45. The exception to this rule occurs when you enter a number that is wider than the cell. In this case, Excel usually expands the width of the column to fit the number. However, in some cases, Excel tailors the number to fit the cell by rounding off some decimal places. For example, a number such as 123.45678 is displayed as 123.4568. Note that, in this case, the number is changed for display purposes only; Excel still retains the original number internally.
When you create a worksheet, each cell uses this format, known as the General number format, by default. If you want your numbers to appear differently, you can select from among Excel’s seven categories of numeric formats: Number, Currency, Accounting, Percentage, Fraction, Scientific, and Special:. Number formats—The number formats have three components: the number of decimal places, whether the thousands separator (,) is used, and how negative numbers are displayed. For negative numbers, you can display the number with a leading minus sign, in red, surrounded by parentheses, or in red surrounded by parentheses.
NOTE Although you can select a number as high as 30 in the Decimal Places spin box, Excel will only display the first 14 decimal places. This applies to percentages as well (see below). Currency formats—The currency formats are similar to the number formats, except that the thousands separator is always used, and you have the option of displaying the numbers with a leading dollar sign ($) or some other currency symbol. Accounting formats—With the accounting formats, you can select the number of decimal places and whether to display a leading dollar sign (or other currency symbol). If you do use a dollar sign, Excel displays it flush left in the cell. All negative entries are displayed surrounded by parentheses.
Percentage formats—The percentage formats display the number multiplied by 100 with a percent sign (%) to the right of the number. For example,.506 is displayed as 50.6%. You can display up to 14 decimal places. Fraction formats—The fraction formats enable you to express decimal quantities as fractions. There are nine fraction formats in all, including displaying the number as halves, quarters, eighths, sixteenths, tenths, and hundredths. Scientific formats—The scientific formats display the most significant number to the left of the decimal, 2–30 decimal places to the right of the decimal, and then the exponent. So, 123000 is displayed as 1.23E+05.
Special formats—The special formats are a collection designed to take care of special cases. Here’s a list of the special formats, with some examples: Format Enter This It Displays as This ZIP code 1234 01234 ZIP code + 4 12345-6789 Phone number 123456789 (123) 456-7890 Social Security number 123456789 1 Changing Numeric Formats The quickest way to format numbers is to specify the format as you enter your data. For example, if you begin a dollar amount with a dollar sign ($), Excel automatically formats the number as currency.
Similarly, if you type a percent sign (%) after a number, Excel automatically formats the number as a percentage. Here are a few more examples of this technique. Note that you can enter a negative value using either the negative sign (–) or parentheses. Number Entered Number Displayed Format Used $1234.567 $1,234.57 Currency ($1234.5) ($1,234.50) Currency 10% 10% Percentage 123E+02 1.23E+04 Scientific 5 3/4 5 3/4 Fraction 0 3/4 3/4 Fraction 3/4 4–Mar Date.
NOTE Excel interprets a simple fraction such as 3/4 as a date (March 4, in this case). Always include a leading zero, followed by a space, if you want to enter a simple fraction from the formula bar.
Specifying the numeric format as you enter a number is fast and efficient because Excel guesses the format you want to use. Unfortunately, Excel sometimes guesses wrong (for example, interpreting a simple fraction as a date). In any case, you don’t have access to all the available formats (for example, displaying negative dollar amounts in red).
To overcome these limitations, you can select your numeric formats from a list. Here are the steps to follow:. Select the cell or range of cells to which you want to apply the new format. Select the Home tab. Pull down the Number Format list.
Excel displays its built-in formats, as shown in. Under the name of each format, Excel shows you how the current cell would be displayed if you chose that format. In the Home tab, pull down the Number Format list to see all of Excel’s built-in numeric formats. Click the format you want to use. For more numeric formatting options, use the Number tab of the Format Cells dialog box. Select the cell or range and then select Home, Number Format, More Number Formats.
(You can also click the Number group’s dialog box launcher or press Ctrl+1.) As you can see in, when you click a numeric format in the Category list, Excel displays more formatting options, such as the Decimal Places spin box. (The options you see depend on the category you select.) The Sample information box shows a sample of the format applied to the current cell’s contents. When you select a format in the Category list, Excel displays the format’s options. As an alternative to the Format Cells dialog box, Excel offers several keyboard shortcuts for setting the numeric format. Select the cell or range you want to format, and use one of the key combinations listed in Table 3.6. Shortcut Keys for Selecting Numeric Formats Shortcut Key Format Ctrl+ General Ctrl+ Number (two decimal places; using thousands separator) Ctrl+$ Currency (two decimal places; using dollar sign; negative numbers surrounded by parentheses) Ctrl+% Percentage (zero decimal places) Ctrl+^ Scientific (two decimal places) You can use the controls in the Home tab’s Number group as another method of selecting numeric formats. The Number Format list (see ) displays all the formats.
Here are the other controls that appear in this group: Button Format Accounting Style Accounting (two decimal places; using dollar sign) Percent Style Percentage (zero decimal places) Comma Style Number (two decimal places; using thousands separator) Increase Decimal Increases the number of decimal places in the current format Decrease Decimal Decreases the number of decimal places in the current format Customizing Numeric Formats Excel numeric formats give you lots of control over how your numbers are displayed, but they have their limitations. For example, no built-in format enables you to display a number such as 0.5 without the leading zero, or to display temperatures using, for example, the degree symbol. To overcome these and other limitations, you need to create your own custom numeric formats. You can do this either by editing an existing format or by entering your own from scratch.
The formatting syntax and symbols are explained in detail later in this section. Every Excel numeric format, whether built-in or customized, has the following syntax:. positive format;negative format;zero format;text format The four parts, separated by semicolons, determine how various numbers are presented. The first part defines how a positive number is displayed, the second part defines how a negative number is displayed, the third part defines how zero is displayed, and the fourth part defines how text is displayed.
If you leave out one or more of these parts, numbers are controlled as shown here: Number of Parts Format Syntax Used Three positive format;negative format;zero format Two positive and zero format; negative format One positive, negative, and zero format Table 3.7 lists the special symbols you use to define each of these parts. Numeric Formatting Symbols Symbol Description General Displays the number with the General format. # Holds a place for a digit and displays the digit exactly as typed. Displays nothing if no number is entered. 0 Holds a place for a digit and displays the digit exactly as typed.
Displays 0 if no number is entered.? Holds a place for a digit and displays the digit exactly as typed. Displays a space if no number is entered. (period) Sets the location of the decimal point.,(comma) Sets the location of the thousands separator. Marks only the location of the first thousand.% Multiplies the number by 100 (for display only) and adds the percent (%) character. E+ e+ E– e– Displays the number in scientific format. E– and e– place a minus sign in the exponent; E+ and e+ place a plus sign in the exponent.
/ (slash) Sets the location of the fraction separator. $ ( ): – + Displays the character. Repeats whatever character immediately follows the asterisk until the cell is full. Doesn’t replace other symbols or numbers. (underscore) Inserts a blank space the width of whatever character follows the underscore. (backslash) Inserts the character that follows the backslash.
'text ' Inserts the text that appears within the quotation marks. @ Holds a place for text. COLOR Displays the cell contents in the specified color. COLORn Displays the cell contents in the specified color value (where n is a number between 1 and 56). condition value Uses conditional statements to specify when the format is to be used. Before looking at some examples, let’s run through the basic procedure.
To customize a numeric format, select the cell or range you want to format and then follow these steps:. Select Home, Number Format, More Number Formats (or press Ctrl+1) and select the Number tab, if it’s not already displayed. In the Category list, click Custom. If you’re editing an existing format, select it in the Type list box. Edit or enter your format code. Excel returns you to the worksheet with the custom format applied.
Excel stores each new format definition in the Custom category. If you edited an existing format, the original format is left intact and the new format is added to the list. You can select the custom formats the same way you select the built-in formats. To use your custom format in other workbooks, you copy a cell containing the format to that workbook. Shows a dozen examples of custom formats. Sample custom numeric formats.
Here’s a quick explanation for each example:. Example 1—These formats show how you can reduce a large number to a smaller, more readable one by using the thousands separator. A format such as 0,000.0 would display, for example, 12300 as 12,300.0. If you remove the three zeros between the comma and the decimal (to get the format 0.0), Excel displays the number as 12.3 (although it still uses the original number in calculations).
In essence, you’ve told Excel to express the number in thousands. To express a larger number in millions, you just add a second thousands separator. Example 2—Use this format when you don’t want to display any leading or trailing zeros. Example 3—These are examples of four-part formats. The first three parts define how Excel should display positive numbers, negative numbers, and zero. The fourth part displays the message “Enter a number” if the user enters text in the cell.
Example 4—In this example, the cents sign (¢) is used after the value. To enter the cents sign, press Alt+0162 on your keyboard’s numeric keypad. (This won’t work if you use the numbers along the top of the keyboard.) Table 3.8 shows some common ANSI characters you can use. ANSI Character Key Combinations Key Combination ANSI Character Alt+0162 ¢ Alt+0163 £ Alt+0165 ¥ Alt+0169 © Alt+0174 ® Alt+0176 °. Example 5—This example adds the text string 'Dollars' to the format. Example 6—In this example, an M is appended to any number, which is useful if your spreadsheet units are in megabytes.
Example 7—This example uses the degree symbol (°) to display temperatures. Example 8—The three semicolons used in this example result in no number being displayed (which is useful as a basic method for hiding a sensitive value). Example 9—This example shows that you can get a number sign (#) to display in your formats by preceding # with a backslash ( ). Example 10—In this example, you see a trick for creating dot trailers. Recall that the asterisk (.) symbol fills the cell with whatever character follows it. So, creating a dot trailer is a simple matter of adding '.'
To the end of the format. Example 11—This example shows a similar technique that creates a dot leader. Here, the first three semicolons display nothing; then comes '.' , which runs dots from the beginning of the cell up to the text (represented by the @ sign). Example 12—This example shows a format that’s useful for entering stock quotations. Hiding Zeros Worksheets look less cluttered and are easier to read if you hide unnecessary zeros.
Excel enables you to hide zeros either throughout the entire worksheet or only in selected cells. To hide all zeros, select File, Options, click the Advanced tab in the Excel Options dialog box, and scroll down to the Display Options for this Worksheet section. Clear the Show a Zero in Cells That Have Zero Value check box and then click OK. To hide zeros in selected cells, create a custom format that uses the following format syntax: positive format;negative format; The extra semicolon at the end acts as a placeholder for the zero format.
Because there’s no definition for a zero value, nothing is displayed. For example, the format $#,##0.00);($#,##0.00); displays standard dollar values, but it leaves the cell blank if it contains zero.
TIP If your worksheet contains only integers (no fractions or decimal places), you can use the format #,### to hide zeros. Using Condition Values The action of the formats you’ve seen so far have depended on whether the cell contents were positive, negative, zero, or text. Although this is fine for most applications, sometimes you need to format a cell based on different conditions.
For example, you might want only specific numbers, or numbers within a certain range, to take on a particular format. You can achieve this effect by using the condition value format symbol. With this symbol, you set up conditional statements using the logical operators =, =, and, and the appropriate numbers. You then assign these conditions to each part of your format definition. For example, suppose you have a worksheet for which the data must be within the range −1,000 and 1,000. To flag numbers outside this range, you set up the following format: =1000'Error: Value = 1,000';.
TIP Excel for the Macintosh uses a different date system than Excel for Windows uses. If you share files between these environments, you need to use Macintosh dates in your Excel for Windows worksheets to maintain the correct dates when you move from one system to another. Select File, Options, click Advanced, scroll down to the When Calculating This Workbook section, and then select the Use 1904 Date System check box. Customizing Date and Time Formats Although the built-in date and time formats are fine for most applications, you might need to create your own custom formats. For example, you might want to display the day of the week (for example, Friday). Custom date and time formats generally are simpler to create than custom numeric formats.
There are fewer formatting symbols, and you usually don’t need to specify different formats for different conditions. Table 3.10 lists the date and time formatting symbols. Sample custom date and time formats. Deleting Custom Formats The best way to become familiar with custom formats is to try your own experiments. Just remember that Excel stores each format you try.
If you find that your list of custom formats is getting a bit unwieldy or that it’s cluttered with unused formats, you can delete formats by following the steps outlined here:. Select Home, Number Format, More Number Formats. Click the Custom category. Click the format in the Type list box.
(Note that you can delete only the formats you’ve created yourself.). Click Delete.
Excel removes the format from the list. To delete other formats, repeat steps 2-4.
Excel returns you to the spreadsheet.