Thursday Nov 06, 2008

Date conversions 

In spreadsheets like OpenOffice.org Calc, some automatic functions try to make your life shorter. Ooops, I mean, they try to speed up your tedious daily task of typing data by guessing what you really meant when you typed what you typed.

You want to use Calc to create a list of book chapter numbers in column A. You start with chapter  1. No problem. Then comes 1.1 as the first subchapter. Wonderful. Now this has another level of subchapters, so you type 1.1.1 and - bad luck - it got entered as 01/01/01.

Calc guessed that 1.1.1 must be a date rather than something else. Being the cute person that you are, you immediately press the Undo keys Ctrl+Z to undo the formatting. Bad luck again. Calc thinks you want to undo the formatting and the typing, and your cell is empty.

You can avoid these automatic replacements in two ways:

  • Format the cells where you want to type the chapter numbers as "Text" before typing something into these cells. Select the cells and choose Format > Cells. Click the Numbers tab. Select the Text category and click OK.
  • Enter an apostrophe ' before typing the data. The apostrophe does not appear in the cell. It indicates that the data should be left right as you typed them.

Note that if you have Custom Quotes set up, the apostrophe will itself be corrected into a smart quote and this will prevent it being recognised properly. To avoid this, either press Ctrl+Z immediately after typing the apostrophe each time (which undoes the correction to smart quote but does not remove the apostrophe) or go to Tools > AutoCorrect... > Custom Quotes and remove the tick from Replace under "Single quotes" once (which suppresses the unwanted correction).

Case conversions

Another automatic replacement in Calc saves you from pressing or accidentally not pressing the Shift key, no matter if you wanted that or not. Strange. This is the feature known as AutoInput.

You want to create column A with the big and small letters of the alphabet. In column B you will later enter a count for each letter, how often it appears in a book. You type a in B1 and b in B2 and c in B3 and so on. When you come to type A and B and C further down the column, they are all converted to the lower case letters.

AutoInput looks at the other text cells in the same column, and when you enter something that already exists - no matter if upper case or lower case - your new input gets converted to the same case.

Choose Tools > Cell Contents and click AutoInput to remove the tick from that switch. The Calc Help has some more information at the index entry AutoInput.

This blog copyright 2009 by fpe