## Specifying the Type of Data in a Cell

The spreadsheet tutorial in this section used fairly straightforward types of data that Calc could easily recognize — sequences of characters from the alphabet and spaces are probably words, whereas numbers and decimal points are probably numeric values. Knowing the type of data that is contained in a cell (generally referred to as its data type or data format) is fairly important, especially when you subsequently want to invoke functions that calculate values from the contents of various cells.

When you enter values in a spreadsheet without specifying their type, spreadsheets such as Calc assign them a general data format, which performs a best-guess of their data format based on the type of characters that they contain. However, you can also manually specify the format of any cell (or cells) by selecting those cells and using the commands on the Format C> Cells dialog, shown in Figure 17-18.

Specifying cell data formats in Calc

Specifying cell data formats in Calc

As an example, note that cell C3 in your example spreadsheet (most recently shown in Figure 17-12) doesn't display the traditional number of decimal places that you'd expect to see in a monetary value. This is because Calc's general data format recognized it as a decimal number, but didn't have any way of knowing that this was a monetary value. To correct this, select that cell, select the Format C> Cells command, and click Currency in the pane at left. This displays a list of possible representations for that data format, as shown in Figure 17-19.

Note that two decimal places is the default for this data type, which is what you are trying to correct. Because this would do the trick, click OK to set cell C3 as a currency value and close the Format Cells dialog. This updates the spreadsheet, which now shows the correct number of decimal places for cell C3, as shown in Figure 17-20.

FIGURE 17-19

Specifying that a cell contains a currency value

FIGURE 17-19

Specifying that a cell contains a currency value