Understanding Number Formats

By default, all numbers entered in your spreadsheets use the Standard number format. This Standard format is also known as the General number format and shows numerical entries with no decimal places and no special formatting (such as commas or dollar signs).

While the Standard, Currency, and Percentage formats are easily accessible from the Object toolbar, the other formats available for your numbers are found in the Cell Attributes dialog box.

To Apply Cell Number Formats

1.
Select the cell or cells that you wish to assign a number format to.

2.
Select the Format menu, then select Cells. Or, right-click the selected cell or cells and select Format Cells from the context menu. The Cell Attributes dialog box appears (see Figure 3.3).

Figure 3.3. Select a range of cells and then click the appropriate formatting button on the Object toolbar.


3.
Make sure the Number tab is selected on the Cell Attributes dialog box. To view the number formats available in a particular category, select a category in the Category box (such as Currency). The formats available for a particular category will appear in the Format box.

4.
Use the Options box to set options such as the number of decimal places or the number of leading zeros allowed.

5.
Once you have selected a format and have set options for that format, click OK to assign the format to the selected cell or cells.

The Cell Attributes dialog box also provides a drop-down list that allows you to change the language used for the numerical formatting of a range of cells. So, for example, if you wish to use Spanish as the language selection, click the drop-down list and select Spanish.

Note

When you select a particular numerical format, a Preview of the format is provided in the Preview box of the Cell Attributes dialog box.


To Apply the Currency Format

In terms of currency formatting, you can also select the type of currency that is being used in a particular cell (as well as the overall currency formatting). For example, if you are working with the Rand from South Africa (rather than dollars from the U.S.), you would select the Rand as your currency type in the drop-down list that appears at the top of the Format box in the Cell Attributes dialog box.

As you've probably already seen in the Category box of the Cell Attributes dialog box, there is a number of categories provided for numerical formats. Table 3.1 provides a brief description of each format category (precluding the date and time formats that are discussed later in this chapter). Figure 3.4 provides an example of each of the format categories.

Figure 3.4. Calc provides a number of different number format categories and format choices within each category.


Table 3.1. Number Formats and How They Work
Format Category How It Works
Number Displays the number as you type it (depending on column width). This category includes the General format as the default format for numbers.
Percent Displays the number as a percentage with the percent symbol. To get the percentage 79%, you would enter.79.
Currency Places a dollar sign (if using U.S. dollars) at the beginning of an entry and also puts commas in the number. Places the decimal point and two decimal places (typical for currency). Other currency selections are based on different monetary systems such as the British Pound or the French Franc.
Scientific Displays the value using an exponent.
Fraction Displays the value as a fraction (for example, .75 displays as Ω).
Boolean Allows you to format the cell or cells as a Boolean value. This formatting is used for logical statements placed in spreadsheets and values can either be TRUE or FALSE as related to the Boolean argument.
Text Displays values as you type them, but formats the values as text, meaning the values are no longer valid for use in formulas or functions. Calc treats cells formatted as Text as text entries.

Each category provides several different formatting possibilities, which include different ways to portray negative values and the number of decimal places available. Obviously, some of the formats lend themselves to more obvious uses, such as the Currency and Percent formats. Just keep in mind that as far as “raw” values go, the best format is the General format (which is the default).

One thing that you should definitely keep in mind: If the value you have entered in a particular cell and then applied a particular format to exceeds the column width set for the column that it resides in, a series of number signs (#) will appear across the cell.This means that the column width needs to be adjusted to accommodate the value and its formatting. Just double-click on the column's border to set the column to accommodate the largest entry in the column. More about changing column widths is discussed later in this chapter.

To Apply Decimal Places and Leading Zeros

A few words should be said about decimal places and leading zeros. You can quickly change the number of decimal places available to a particular numerical format using either the Add Decimal Place tool or the Delete Decimal Place tool on the Object toolbar. Select the cell or cells for which you wish to change the number of decimal places and then click the appropriate button to add or delete decimal places.

For instance, to change the number of decimal places or leading zeros that are part of a numerical format found in the Cell Attributes dialog box, select the number format and then use the Decimal Places or Leading Zeros click boxes in the Format box, respectively.

To Apply the Date and Time

Several formats are also available for date and time entries, and they deserve some special discussion. Dates are actually seen by your computer as the number of days that have passed since December 31, 1899 (January 1, 1900 would be considered day 1).

You can enter dates into your Calc spreadsheets using the format M/D/YY (which is the default formatting for dates in a Calc spreadsheet); for example, 03/12/01. Or, you can actually abbreviate or spell out the month. For example, the entry Jan 5 01 will be recognized by Calc as a date and converted to 01/05/01 in the spreadsheet cell.

A number of other date formats are available such as December 31, 1999 (where the month is spelled out and the day is separated from the four-digit date by a comma), Fri, Dec 31, 99, and date formats that include the current time.

Calc also sees time as a numerical value; it is seen as a decimal value that represents the percentage of the day that has elapsed since midnight. For instance, .50 would be 12 noon. Fortunately, a time value will appear in a format that looks like something that would appear on a digital clock. Time formats such as HH:MM (hours and minutes) and HH:MM:SS (hours, minutes, and seconds) are offered.

When you enter times into your spreadsheets, enter the hour followed by the minute in the format HH:MM. If you wish to include the time with the date, format the cell holding the date to show the time that the cell information was entered (using the Cell Attributes dialog box to select the appropriate date format).

To Create Your Own Format

While there are probably more than enough “built-in” numerical formats for you to use, you may find the occasion when you have to change one of the default formats to meet your value formatting needs. When you change an existing format, Calc automatically begins creating a user-defined category for you. Your new format (based on the default format you edited) will appear under the User-Defined category in the Cell Attributes dialog box. Once the new format has been created, you can then assign it to other cells in the spreadsheet as needed. You can also create user-defined formats from scratch as follows:

1.
Open the Cell Attributes dialog box and select the User-defined category. You can now create your own format in the Format code box.

2.
Use the pound sign (#) as a placeholder for numbers in your user-defined formats. The period is used to place the decimal place and is followed by the number of decimal places you wish to have in the format. The number of decimal places is set for your new code using the Decimal places click box in the Format box. Table 3.2 provides some of the codes that you can use to create your own formats.

Note

The best way to learn how to create your own formats is to look at the format codes that have been created for the different numerical formats provided by Calc. You can then use any of these format codes as a jumping off point for special formats that you create.

3.
Once you create your special format in the Format code box, click OK to assign the format to the currently active cell or cells. You can now use the special format to format other cells in your current spreadsheet.

Table 3.2. Formatting Codes
Format Type Code Example Usage
Number # #,### Number placeholder; this particular example provides for no decimal places, but does insert a comma at the thousands mark. The number of #s placed in the code for your format does not limit the number of characters that you can type in a cell formatted with the code.
Currency (Dollar, U.S.) $ $###.## Designates that the numerical format following the $ should be formatted as U.S. currency.
Currency (Pound, British) £ £###.## Designates that this currency format is for British (Great Britain) pounds.
Percent % 0.000% This example would create a percent format that includes three decimal places.
Date (Month) M M/D/YY The current month would be displayed as one or two digits.
Date (Day) D M/D/YY The day would be displayed as one or two digits.
Date (Year) Y M/D/YY The year would be displayed as a twodigit number. For example, 2001 would be displayed as 01.
Time (Hour) H HH:MM The hour would be displayed as a twodigit number.
Time (Minute) M HH:MM The minutes would be displayed as a two-digit number.

Note

If you need to format your currency for the Euro, use the code: #.##0,00 “EUR”;[ROT]-#.##0,00 “EUR.” Two ready-made Euro codes can also be found in the Number formats under EUR.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.119.199