Copyright © 2002 Pamela Roberts
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
KSpread is a full featured spreadsheet program.
Table of Contents
This handbook is dedicated to the memory of Visicalc.
KSpread is a full featured spreadsheet program. It is part of the KOffice productivity suite for the K Desktop Environment KDE.
Other KOffice applications include KWord, (word processing), KPresenter (slide presentation creator), KChart (for producing charts and graphs) and Kontour (a drawing program).
You might care to visit http://www.kde.org for more information about KDE in general, or the KOffice web site at http://www.koffice.org
Like the rest of KDE, KSpread is highly configurable, which can cause problems for readers trying to compare the text in a document such as this with what they see on the version of KSpread running on their desktop. To cut down on some of the possibilities for confusion, it it suggested that when you first start to use KSpread you set the default options in all pages of the KSpread configuration dialog (obtained by selecting Settings->Configure Kspread...) except for Completion mode in the Misc page, which shoud be set to None.
You may also find it helpful to enable Tooltips in the K menu Preferences->Look & Feel->Widget Settings dialog box.
This section attempts to explain by example what a spreadsheet program such as KSpread actually does, and why it is such a useful tool in any situation where you have to deal with numbers. If you have already used a spreadsheet program you may wish to skip to the next section.
The first thing to do is to start up KSpread. You can do this by left clicking on a KSpread icon if there is one on your desktop or panel, or you can select Office->KSpread from the K menu.
When it has started you will be given the choice of creating a new document from a template, opening an existing or recent document, or starting with an empty document. Choose Start with an empty document .
Looking at KSpread once it has started up, you will see a table of empty rectangular cells arranged in numbered rows and lettered columns. This is where you enter data or formulae, text or charts.

Now, enter the text and values shown in the first 5 rows of the above screenshot into the same cells of your spreadsheet. Ignore what is in row 7 for the moment. To enter anything into a cell first select the cell by left clicking inside it, then type whatever you want, then press Enter or use the arrow keys to move the selection point to another cell.
What we have entered so far could be a simple budget for the next two months, listing how much we think we will be spending for Food, Shelter, Clothing and any Other expenditure. Now select cell B7 (column B, row 7), type in =B2+B3+B4+B5 and press Enter. Because it begins with a = symbol KSpread sees this as a formula, something it has to calculate, in this case by adding together the values in the 4 cells B2 to B5, and what is shown in the cell B7 is the result of that calculation.
You could enter a similar formula into cell C7, except that in this case it would have to be =C2+C3+C4+C5, but there is an easier way which is to Copy cell B7 and Paste it into C7. KSpread will automatically adjust the cell references from B.. to C.. when the Paste is done.
At this point you may think that KSpread is doing no more that you could manage with pencil, paper and a calculator, and you could be right, but remember that this is a very small example of a spreadsheet, doing simple calculations on only a few numbers. For any reasonably sized table of values using a spreadsheet to do the calculations is much quicker and more accurate than doing them manually.
Also, a spreadsheet lets you play the “What if?” game. Because each formula is automatically recalculated whenever any of the values it refers to are changed, you can quickly see what happens if you alter any of them. Using our example you can see the effect of reducing the amount spent on food in December by just entering a new value into cell C2. If you had a spreadsheet that modelled the greenhouse effect accurately you could perhaps see the effect of a 50 percent reduction in the amount of methane released into the atmosphere.
You can select a single cell or a rectangular area of cells in the spreadsheet. The selected cell(s) are displayed with a thick black border .
To select a single cell left click on it or enter the cell reference (for example B5) into the cell reference box at the left end of the Formula toolbar and press Enter, or use the View->Goto Cell... menu option.
You can also steer your way around with the arrow keys. Pressing the Enter key will move the current selection one position up, down, left or right depending on the setting in the Misc page of KSpread's configuration dialog box.
If you hold the Ctrl key down while using the arrow keys the selection will move to the start or end of the block of occupied cells.
To select an area of cells drag the mouse cursor across the wanted area with the left button held down, or enter the references of the top left and bottom right cells separated by a colon into the Formula toolbar cell reference box (for example B7:C14 ) and press Enter, or enter these cell references in a similar format into the dialog box brought up by View->Goto Cell....
You can also select an area of cells by selecting the cell in one corner of the wanted area then holding the Shift key down while using the left mouse button to select the cell in the opposite corner.
To select a complete row or column of cells left click on the row number at the left of the worksheet or on the column letters at the top. To select adjacent rows or columns drag the mouse pointer over the appropriate row numbers or column letters with the left button held down.
Entering data into a cell can be as simple as selecting the cell, typing your data, then pressing Enter or moving the selection to another cell with one of the arrow keys. Depending on how you enter the data, KSpread will interpret it as a number, date, time or text:
Numbers are entered in the obvious way; 123, -123, 456.7 or in scientific notation -1.2E-5.
Dates should be entered in your “System” format, as defined in the K menu Preferences-> Personalisation->Country & Languages dialog box. If, for example, you are using the DD/MM/YYYY form you should enter 30/03/2002 for 30th. March 2002. Leading zeroes can be omitted from the day and month fields and only the last one or two digits of the year need to be entered if the date is in the current century, for example 9/1/2 for 9th January 2002.
Times should also be entered using the “System” format. For example if you are using a 12 hour clock then enter times in HH:MIN am|pm or HH:MIN:SS am|pm format such as 9:42 am or 10:30:52 pm
KSpread defines any input data as “text” if it can not recognize as being a number, date or time.
By default, KSpread right justifies numbers, dates and times within a cell and left justifies anything else. This can be a useful guide to whether you have entered a date or time in the correct format. But remember that how items are displayed can be changed by altering the cell format.
The main text entry box in the Formula toolbar provides an easy way of editing the contents of a selected cell. Press Enter or left click on the green tick mark when you are happy with what you have entered, or click on the red cross to cancel your edits.
At first glance, KSpread's Cut, Copy and Paste appear to be similar to these functions in other KDE applications. Having selected a cell or cells, you can choose Copy or Cut from the Edit menu or from the drop down menu you get by holding the right mouse button down on a selected cell, or just use the shortcuts Ctrl+C or Ctrl+X, then you can move the selection to the target cell and choose Paste or use the shortcut Ctrl+V. However there are some subtleties associated with these functions in KSpread and these are discussed below.
If a cell contains a formula then the formula itself is copied rather than the displayed result, and if the formula contains a reference to another cell, then that reference is changed by the Cut or Copy and Paste operation to point to the cell that is in the same relative position as in the original cell. For example if cell A2 contains the formula =B3 and is copied to C4, cell C4 will contain =D5 .
This may seem to be a rather strange way of doing a copy, but 99 percent of the time it is exactly what is wanted (if it is not then see the section about absolute cell references). For example in the simple shopping list shown below, cell D2 should contain =B2 * C2, D3 should be =B3 * C3, D4 should be =B4 * C4 and so on. Instead of having to enter a different formula in each cell, you can just enter the first formula into D2 and then copy it into the cells below, letting KSpread adjust the cell references to suit.

In the above example D2 can be copied into all three cells D3 to D5 at once by just copying D2 then selecting the complete cell area D3:D5 before doing the paste.
A rectangular area of cells can be cut or copied in one operation by selecting the area before doing the cut or copy. Then select the top left corner cell of the area you want to paste into before doing the paste.
If you cut or copy a rectangular area of cells, say B2:C3, and paste it into a larger area such as A10:D13 the original pattern of cells will be repeated to fill the target area.
KSpread also provides a “Drag and Copy” method for copying cells down into other cells immediately below or to the right of the original cell(s). To use this method select the cell(s) to be copied then position the mouse pointer over the small black square at the bottom right corner of the selected cell(s) so the cursor changes to a double headed arrow. Then hold the left mouse button down while you drag the selected cell(s) as far as you wish.
A cell may contain text, a value, or a formula, and may also contain special font, border or background formatting information. KSpread has special versions of Paste that let you handle these items in different ways.
Special Paste... brings up the Special Paste dialog box. By selecting the appropriate item from the top part of this dialog you can choose to paste just Text , the cell Format, any Comment in the cell(s) or Everything without border. The items in the bottom part of this dialog box allow you do do simple arithmetic on an area of cells.
Paste with Insertion... inserts the copied cell(s) into the sheet by moving the cells that would otherwise be overwritten a suitable number of rows of columns down or to the right. It can also be used to insert complete copied row(s) or column(s) into the worksheet.
Use the Delete key or Edit ->Clear->Text to remove the text, value or formula from selected cell(s), row(s) or column(s) without affecting anything else.
To delete everything in the selected cell(s), row(s) or column(s), including comments and special formatting, use Shift+Delete or choose the Delete option from the Edit menu or from the pop up menu you get when you right click on a selection.
To remove selected row(s) or column(s) completely, use the Delete Row(s)... or Delete Column(s)... options from the right mouse button pop up menu.
If you select a cell or cells and choose Remove Cells... from the right mouse button pop up menu, you can then choose whether other cells in the worksheet will be moved up or to the left to fill in the space left by the cell(s) you have chosen to remove.
If you want to insert new, blank, row(s) or column(s) into the sheet, select row(s) or column(s) where you wish the new row(s) or column(s) to be placed and choose the Insert Row(s)..., Insert Column(s)... option from the right mouse button pop up menu.
You can insert new cells into the worksheet by selecting the area where you want them to appear then choosing the Insert Cells... option from the right mouse button pop up menu. You will then be asked whether the existing cell(s) in the selected area should be moved down or to the right to make room for the new ones.
If the first character in a cell is an equals sign (=) KSpread will take the cell contents to be a formula which is to be calculated. The result of the calculation will be displayed in the cell rather than the formula itself. For example, enter =2+3 into a cell and it should display 5.
More usefully, a formula can contain references to other cells, so that =B4+A3 will calculate the sum of the values in cells B4 and A3, and this calculation will be updated whenever cells B4 or A3 are changed.
As well as addition, a formula can make use of the - symbol for subtraction, * for multiplication, and / to perform division. The round bracket symbols ( and ) can also be used as in normal algebra, so you could enter more complex formulae such as =((B10 + C3) *5 - F11) / 2 .
Cells containing a formula will be marked with a small blue triangle at the bottom left corner if the Show formula indicator checkbox in the Preferences page of KSpread's configuration dialog is checked.
KSpread also includes a large number of built-in functions for applications such as statistical, trigonometrical and financial calculations. Their use will be examined in more depth in a later section of this manual, but if you are interested at this stage choose Function... from the Insert menu and take a look through the Function dialog box that will be displayed..
For the time being, however, the SUM function may be of interest as it calculates the sum of all values in a specified area of cells. For example =SUM(B4:C10) calculates the sum of all values in the cell area B4 to C10.
If KSpread displays a row of # symbols when you have entered your formula this usually means that it cannot understand what you have entered, but if the row of # symbols ends with a small red arrow this just means that the cell is not wide enough to display the complete result, in which case you should either make the cell(s) wider or change their format so that the result does fit properly.
If the Automatic recalculation box in the Preferences page of the Settings->Configure KSpread... dialog box is checked, KSpread will recalculate the values of cells whenever anything that affects them is changed.
You can instruct KSpread to perform a recalculation at any time by using the Recalculate Sheet or Recalculate Workbook options in the Tools menu or their shortcuts Shift+F9 or F9.
In the simple example shown below, the data consists of the names and countries of a number of mountains together with their height above sea level. KSpread can sort data such as this in different ways.

We may want the data sorted so that the names are in alphabetical order. To do this select the area containing the data (A2:C7 in this case) and choose Sort Increasing or Sort Decreasing from the Data menu.
Sorting is done alphanumerically, and is case sensitive, numbers coming before upper case letters which come before lower case letters, so that cells containing the entries Cat, bar, 77 and Bat would be sorted into the following order: 77 Bat Cat bar.
The Sort Increasing and Sort Decreasing options from the Data menu options sort the data according to the contents of the cells in the left column of the selected area. For more complex sorting select Data ->Sort... to bring up the Sort dialog box.
Using the Sort criteria page of this dialog box you can choose which column of the data is to be used as a primary sort key and, if you wish, other columns to be used as secondary and tertiary keys. Using the example in the above screenshot, choosing column B as the first key and column C as the second would sort the data by country and, for each country, by height.
The Options page lets you sort by row instead of by column and allows you to sort using the order of items in a custom list such as January, February... instead of alphanumerically.
KSpread can also place the results of a sort into a different area of the sheet, or even into a different worksheet, rather than overwriting the original data. To do this enter the top left cell reference of the target area into the Starting cell: text box in the Options page. The cell formats will also be copied to the new area if you check the Copy layout box. If you check the First row contains header box data in the first row will be copied directly to the first row of the target area without being included in the sort operation.
The left hand end of the Statusbar shows a summary of the values in the selected cell(s). According to the setting of the Method of calc: drop down box in the Misc page of KSpread's configuration dialog the summary can be:
The value displayed is the sum of the values in the selected cells.
The value displayed is the minimum of the values in the selected cells.
The value displayed is the maximum of the values in the selected cells.
The value displayed is the average of the values in the selected cells.
The value displayed is the number of cells containing numeric values.
No summary calculation is performed.
The method of calculation can also be changed by right clicking on the summary calculation result area of the Statusbar and choosing an item from the pop up menu.
KSpread saves the complete workbook, which may include more than one worksheet, as a single document file.
If you have created a new workbook, or want to save an existing one under a different name, use File-> Save As.... This will bring up KDE's common Save Document As dialog box. Choose the directory where you want to save the workbook and enter a suitable file name into the Location: text box. KSpread documents are normally automatically saved with a .ksp extension, you do not need to add this to the filename but do make sure that the Filter: selection is set to KSpread.
To save your workbook without changing its name, just use File->Save.
You can also save a KSpread workbook in a foreign format, see the Import Export section for more information about doing this.
When you save a modified version of an existing workbook KSpread will keep the previous version as a backup file, adding a ~ symbol to the end of the filename.
KSpread can provide some protection against losing your work because of a computer crash or because you have closed KSpread without saving the current workbook. It does this by automatically saving the latest version of the document you are working on every few minutes using a modified file name. The autosaved version is normally removed when you next save your workbook, so that it will only exist if it is more up to date than the version that was saved manually. When you open a workbook KSpread checks to see if an autosaved version exists, and if it finds one will offer to open that instead.
Autosaved workbooks are saved with a file name of the form .yourfilename.autosave, note the leading period (.), so that spread1.ksp woud be autosaved as .spread1.ksp.autosave. The autosave feature is user configurable.
If you are going to be creating a lot of similar workbooks you can save yourself time and trouble by first creating a template and then using that as the basis for the individual documents.
To do this first create a workbook containing the common elements, then save it as a template by choosing File->Create Template From Document.... Doing this opens the Create Template dialog box. Enter a name for your new template into the Name: text box and press OK. The next time you start a new workbook by choosing File->New or when you next start KSpread the Choose dialog box will give you the option of creating the new document from your template.
The Create Template dialog box also lets you choose a different picture to be displayed above the template name in the Choose dialog box, and lets you save your templates under different group names, which will appear as different tab pages in the Choose dialog box.
Printing a spreadsheet is basically done by selecting File->Print... which brings up KDE's common Print dialog box where you can choose, among other options, the printer to be used, the number of copies and whether all or only selected pages are to be printed.
By default KSpread will print all items in the current worksheet, but you can restrict this by first selecting the area that you want to be printed then choosing Define Print Range from the Format->Print Range sub menu.
KSpread will print as many pages as are necessary to include all items in the current worksheet. You can quickly see how a worksheet will be spilt into separate pages for printing by checking the View->Show Page Borders box. The boundaries of each printed page will then be marked by colored lines in the worksheet.
For a more detailed view of what is to be sent to the printer, including anything you have asked to be included in the page headers and footers (see below), choose File->Print Preview....
To improve the appearance of the printed output , you can change the fonts, colors, borders and sizes of the cells in the worksheet, see the Spreadsheet Formatting section for more details about how to do this.
You can also use the Page Layout dialog box, invoked by selecting Format->Paper Layout..., to change the orientation of the printed pages, the paper size (this should be suitable for your printer) and the size of the page borders.
The Header and Footer page of the Page Layout dialog box also lets you add text, including items such as the filename, date and page number to the header and footer, of each printed page.
The Print Range: section of the Options page of the Page Layout dialog box provides an alternative way of restricting the printed output to just one part of the worksheet. This page also lets you select whether or not to print the grid, comment indicators and formula indicators, and allows you to repeat selected column(s) or row(s) on each printed page.
To change the appearance of selected cell(s), row(s) or column(s) use the Cell Format... option from the Format menu or from the right mouse button pop up menu. This will bring up the Cell Format dialog box which has several tabbed pages:
The Border page lets you set the appearance of the cell borders. If you have selected more than one cell you can apply different styles to the borders between the cells and that surrounding the selected area.
First select the pattern and color from the Pattern section of the Border page then apply that to different parts of the border by clicking on the appropriate button in the Border section, or on one of the Preselect buttons. The left hand button in the Preselect section will clear any previously applied border(s). Note that you can also add a diagonal strike-through line to the cell(s).
The Text page lets you select the font style, size and color, the cell background pattern and color can be selected from the Background page.
From the Position page you can control the position of text within a cell by making suitable selections in the Horizontal and Vertical areas or by setting the Indent value. You can also choose to have the text appear vertically rather than horizontally, or even at an angle.
The Data Format page of the Cell Format dialog box lets you control how the values of cells are displayed.
The top part of this page lets you select the format to be used when displaying numeric values, dates or times.
The lower part of the Data Format page lets you add a Prefix such as a $ symbol at the start of each item or a Postfix such as $HK to the end. You can also control how many digits are displayed after the decimal point for numeric values, whether positive values are displayed with a leading + sign and whether negative values are shown in red.
You can make the appearance of a cell change according to the value it contains, useful perhaps if you are using KSpread to keep track of your household expenses and want to highlight any item greater than, say, one thousand dollars.
To do this select the cell(s) then choose Conditional Cell Attributes... from the Edit menu. This will bring up the Relational Cell Attributes dialog box where you can set the font type and color of a cell to change when the value meets one or more conditions. Note that the second and third conditions only apply if the previous condition(s) are not met.
Use Clear->Conditional Cell Attributes from the Edit menu to clear any conditional attributes from selected cells.
The Position page in the Cell Format... dialog lets you alter the size of the selected cell(s). Note that changing the height of a single cell will change the height for all cells in that row, similarly changing the width will affect the entire column.
You can also select the row(s) or column(s) to be changed then select Resize Row... or Resize Column... from the right mouse button pop up menu or from the Format->Row or Format-> Column menu.
If you move the mouse cursor so that its tip is over the line between two of the row numbers at the left of KSpread's window the cursor will change to show two parallel lines each with a short arrow headed line coming from it. When the cursor is in this state you can hold the left mouse button down and drag the border between the two rows, changing the height of the upper row. A similar technique can be used to change the width of a column.
Selecting a cell, row or column then choosing Adjust Row , Adjust Column or Adjust Row and Column from the Format or right mouse button menu will set the row height or column width to the minimum needed to properly display the contents.
You can make a number of adjacent rows or columns the same size by selecting them then choosing Format-> Row->Equalize Row or Format->Column->Equalize Column.
It is often convenient to have one cell that spreads across two or more columns or down more than one row. This can be done by merging two or more cells into one. Select the cells to be merged than choose Data->Merge Cells.
To reverse this process, select the merged cell then choose Dissociate Cells from the TData menu.
A finished spreadsheet can often be made to look more attractive by hiding the cells containing intermediate calculations so that only the important data input and result areas are shown.
In KSpread you can hide selected rows or columns by using the Hide Rows and Hide Columns options from the Format->Row, Format ->Column or right mouse button menus. Hidden rows and columns are not displayed on the screen or included in a print out.
Hiding cells in this way also makes them slightly less prone to accidental change.
To un-hide a row or column select Row ->Show Rows... or Column->Show Columns... from the Format menu.
When constructing a spreadsheet you often need to include a series of values, such as 10, 11, 12..., in a row or column. There are several ways you can do this in KSpread.
For a simple short series such as 5, 6, 7, 8... the “Drag and Copy ” method is the simplest. Enter the starting value into the starting cell and the next value of the series into an adjacent cell. Then select both cells and move the mouse pointer so that it is over the small square at the bottom right corner; the cursor will change to a diagonal double headed arrow. Then hold the left mouse button down while you drag the cells down or across as needed.
The step size is calculated as the difference between the two starting values that you have entered. For example if you enter 4 into cell A1 and 3.5 into A2 then select both cells and Drag and Copy them down, the step size will be the value in A2 minus the value in A1, -0.5 in this case so you will get the series 4, 3.5, 3, 2.5, 2...
The “Drag and Copy” method will even cope with series where the step value is not a constant value but is itself a series. So that if you start with 1, 3, 4, 6 Drag and Copy will extend it to 1, 3, 4, 6, 7, 9, 10, 12..., the step value in this example being the series 2, 1, 2, 1...
KSpread also recognizes some special “series” such as the days of the week. Try entering Friday into a cell (note the capitalization) then Drag and Copy it down. To see what special series are available, and perhaps create your own, select Tools ->Custom Lists... .
If you select a cell and choose Series... from the Insert menu you will see the Series dialog box. This is useful for creating series that are too long to be conveniently constructed using the Drag and Copy method, or for creating geometric series such as 1, 1.5, 2.25, 3.375... where the step value, 1.5 in this case, is used as a multiplier.
If the type of series that you want is too complicated for any of the previous methods, consider using a formula and Drag and Copying that. For example to create a series with the values 2, 4, 16, 256... enter 2 into A1, =A1*A1 into A2, and Drag and Copy cell A2 down.
KSpread has a huge range of built in mathematical and other functions that can be used in a formula cell. They can be seen and accessed by selecting a cell then choosing Function... from the Insert menu. This brings up the Function dialog box.
Select the expression you want to use from the listbox at the left of the dialog box then press the button with the down arrow key symbol on it to paste the expression into the text edit box at the bottom of the Math Expression dialog.
The Parameters tab page will then be displayed to let you enter the parameter(s) for the expression you have just chosen. If you want to enter an actual value for a parameter, just type it into the appropriate text box in the Parameters page. To enter a cell reference rather than a value, left click on the appropriate text box in the Parameters page then left click on the target cell in the spreadsheet.
Instead of using the Parameters page, cell references such as B6 can be entered by typing them directly into the edit box at the bottom of the Function dialog. If an expression has more then one parameter separate them with a semi-colon (;).
Pressing the OK button will transfer the expression to the main KSpread window's Formula toolbar edit box and close the Function dialog. Press the Formula toolbar button marked with a large green tick to put the expression into the selected cell.
You can of course do without the Function dialog and simply type the complete expression into the Formula toolbar's main edit box. Function names are not case sensistve. Do not forget that all expressions must start with an = symbol.
Logical functions such as IF(), AND(), OR() take parameters which have the logical (boolean) values True or False. This type of value can be produced by other logical functions such as ISEVEN() or by the comparison of values in spreadsheet cells using the comparison expressions given in the following table.
| Expression | Description | Example |
|---|---|---|
| == | Is equal to | A2==B3 is True if the value in A2 is equal to the value in B3 |
| != | Is not equal to | A2!=B3 is True if the value in A2 is not equal to the value in B3 |
| <> | Is not equal to | Same as A2!=B3 |
| < | Is less than | A2<B3 is True if the value in A2 is less than the value in B3 |
| <= | Is less than or equal to | A2<=B3 is True if the value in A2 is less than or equal to the value in B3 |
| > | Is greater than | A2>B3 is True if the value in A2 is greater than the value in B3 |
| >= | Is greater than or equal to | A2>=B3 is True if the value A2 is greater than or equal to the value in B3 |
Thus if you enter =IF(B3>B1;"BIGGER";"") into a cell it will display BIGGER if the value in B3 is greater than that in B1, otherwise the cell will show nothing.
If a formula contains a cell reference that reference will normally be changed when the cell is copied to another part of the worksheet. To prevent this behavior put a $ symbol before the column letter, row number or both.
If A1 contains the formula =D5 then on copying the cell to B2 it will become =E6 (the normal behavior).
If A1 contains the formula =$D5 then on copying the cell to B2 it will become =D6 (column letter not changed).
If A1 contains the formula =D$5 then on copying the cell to B2 it will become =E5 (row number not changed).
If A1 contains the formula =$D$5 then on copying the cell to B2 it will remain as =D5 (neither the column letter nor the row number are changed).
When you are entering or editing a cell reference in a formula the shortcut key F4 can be used to step through these four possibilities.
Named cells can be used in a similar way to include a unchanging cell reference in a formula.
Sometimes you may want to add a single value to a number of cells, or subtract a value from them, or multiply or divide them all by a single value. The Special Paste... option lets you do this quickly and easily.
First, enter the modifier value into any spare cell on your spreadsheet and Copy it. Then select the area of cells you want to change, choose Special Paste... from the Edit or right mouse button menu and select Addition, Subtraction, Multiplication or Division from the Operation section of the dialog box.
You can also apply different modifier values to different rows or columns of the target area by copying an area containing the wanted modifiers before selecting the target area and doing Special Paste... . For example, if you enter 5 into cell A1, 10 into B1, select both cells and do a Copy then Special Paste... Addition into cells A10 to D15, 5 will be added to A10:A15 and C5:C15, and 10 to B10:B15 and D10:D15.
Note that a modifier value can be a formula as well as a simple numeric value. If it is a formula then KSpread will adjust the cell references as for a normal Paste operation.
KSpread can be used to solve algebraic expressions such as x + x^2 = 4 or For what value of x does x + x squared equal 4 ?.
For this example you could enter =A2+A2*A2 into A1 then either try different values in A2 until the result in A1 is as close as you wish to 4 or, preferably, use KSpread's Goal Seek feature which automatically adjusts the value in one cell to try to make the value in another cell as close as possible to a target value.
It is invoked by selecting Goal Seek from the Data menu. This brings up a dialog box in which you should enter the reference of the target value cell (A1 in this case) into the Set cell box, the target value itself (4) into the to value box and the reference of the cell that is to be changed (A2) into the by changing cell box. Note that you need to have entered some initial value into the cell that is to be changed before starting Goal Seek.
Pressing the Start button in the Goal Seek menu will start the calulation. When it finishes and if it has found a solution press the OK button to accept the result or Cancel to keep the original value.
When you start a new, empty, document with KSpread it will create a number of blank worksheets. The number of sheets it creates is determined by the Number of pages open at the beginning setting in the Interface page of KSpread's configuration dialog box.
Insert->Sheet will add another sheet to the workbook.
If the Show tabs box in the Interface page of KSpread's configuration dialog box is checked a small tab will be shown near the bottom left of KSpread's window for each sheet. Left click on one of these tabs to see that sheet.
You can also switch between worksheets by using the Ctrl+PageDown to move to the next sheet, Ctrl+PageUp to move to the previous one.
Worksheets are given the default names of Sheet1, Sheet2... You can give a sheet a different name by right clicking on the tab and selecting Rename Sheet....
To remove a sheet from the workbook use the Remove Sheet option in the Format-> Sheet submenu or in the little menu that pops up when you right click on the tab for the sheet you want to remove.
Other entries in the Format-> Sheet submenu allow you to show or hide a sheet in much the same way as rows and columns can be hidden.
If you want a formula in one sheet to refer to a cell in another sheet, the cell reference must start with the table name followed by an exclamation mark (!). For example if you enter =Sheet2!A2 into a cell in Sheet 1, that cell will take the value from A2 of Sheet2. Note that sheet names are case sensitive.
You may have constructed a workbook containing several worksheets containing similar data but for, say, different months of the year, and wish to have summary sheet containing the consolidated (sum or average) values of the corresponding data items in the other sheets.
This task can be made slightly easier by using the Consolidate... item from the Data menu.
Selecting this option brings up the Consolidate dialog box.
For each of the source sheets, enter a reference to the wanted data area in the Reference box in the Consolidate dialog then press Add which should transfer it to the Entered References box. The reference should include the name of the sheet containing the source data, such as January!A1:A10, and can be entered automatically by selecting the area in the appropriate table.
When you have entered the references for all of the source data sheets select the cell in the target sheet where you want the top left corner of the consolidated results to appear, choose sum or average from the Function selection box then press the OK button.
If you check the Copy data box in the Consolidate dialog the values resulting from the consolidation will be placed into the target cells rather than the formulae to calculate them.
You can insert a chart into a sheet to give a graphical view of your data.
First select the area of cells containing the data and choose Insert->Chart. The cursor will change to a small cross shape which you should drag across the sheet while holding the left mouse button held down to define the area where you want the chart to appear, there is no need to be too accurate at this stage as the chart size can easily be changed at any time. When you release the mouse button a chart wizard dialog box will appear.
The wizard allows you to define the type of chart, labels and legend that you need. You may wish to refer to the KChart Handbook at this stage, but again if you make a wrong choice you can correct it later. When you press the Finish button the wizard will vanish and you will see the chart embedded into the worksheet.

To move, resize or even delete the embedded chart click anywhere within the chart area. It should now appear with a diagonal hatch border and with a small black square at each corner and in the middle of each edge.
If you move the cursor over any of the black squares it should change to a double headed arrow. You can resize the chart by dragging one of these squares with the left mouse button pressed. To delete the chart right click on one of the squares and select Delete embedded document.
To move the chart move the cursor so that it is over one of the hatched borders. The cursor should then change to a hand, press the left mouse button and you will be able to drag the chart to where you want it to be.
To restore the chart to its normal appearance simply click anywhere outside of the chart area.
To change the format of the chart itself left click twice within the chart area. It should then appear with a diagonal hatch border without any small black squares and KChart's Chart Toolbar should appear in KSpread's window. You can then use these KChart tools or a selection from the menu that pops up when you right click in the chart area to change the chart.
You can insert data from a text file or from the clipboard into a worksheet by first selecting the cell where you want the top left item of the inserted data to appear, then choosing From Text File... or From Clipboard... from the Insert->External Data sub menu.
In both cases KSpread will assume that the data is in CSV form and will open a dialog box allowing you to control how the data is extracted from the file or clipboard and placed into the worksheet cells.
If support for it has been included in your system, KSpread can also insert data from a SQL database into a worksheet. This is done by using the Insert-> External Data->From Database... option.
A spreadsheet cell can be linked to an action so that left clicking on the cell will, for example, open your browser. To make a cell act in this way select it and choose Insert->Link.... This will bring up the Insert Link dialog box, which lets you choose between four types of link:
An Internet link cell will try to open your default browser at the URL entered in the Internet address: text box of the Insert Link dialog when it is clicked. This could be, for example, http://www.koffice.org.
Clicking on a cell containing a Mail link will open your email composer using the address entered in the Email: text box as the To: address. For example anon@example.com.
A File link cell holds the path to a file or directory, as entered into the File location: text box, and will try to open that file or directory with a suitable application when clicked on.
The Cell type of link cell holds a KSpread cell reference, entered in the Cell: text box. Left clicking on this type of link cell causes KSpread's focus to move to the target cell.
All four types of link cell need some suitable text to be entered into the Comment: field of the Insert Link dialog. This is the text that appears in the cell, you can set its style to Bold or Italic if you wish.
KSpread can automatically check the validity of entered data against a number of criteria, and pop up a message box if the data is invalid.
To enable this feature, select the cell(s) to be monitored and choose Edit->Validity.... This will bring up KSpread's Validity dialog box which has two tabbed pages.
In the Values page select what type of data is to be considered valid from the Allow: drop down list then define the valid range of values by choosing one of the options in the Data: drop down list and entering suitable value(s) into ont or both of the edit box(es).
When you have done this change to the Error Alert tab page. Here you can choose the type of message box (Stop , Warning or Information ) that will appear when an invalid value is entered, and define the message box title and message text.
Note that this feature only checks data that you enter into the cell, for a way of checking the results from formulae cells see the Conditional Cell Attributes section of this Handbook.
If your spreadsheet is so large that you can not see all of it at once, splitting KSpread's window into two or more views can help you work on it. This is done by selecting View-> Split View which will split the current view into two parts. View->Splitter Orientation lets you choose between horizontal and vertical splitting.
This technique is particularly useful when you want select an area of the spreadsheet that is larger than can be shown in one view, perhaps to paste a copied cell into it. Use the scrollbars to position the two views to show the top left and bottom right cells of the wanted area, select the top left cell in one view then hold the Shift key pressed while you select the bottom right cell with the left mouse button.
If there is more than one sheet in your workbook, you can show a different sheet in each of the split views.
The relative sizes of the views can be changed by dragging the thick bar separating the them.
To remove a view select View-> Remove View
You can give a name such as foo to a cell or to any area of a sheet by selecting the cell or area then selecting Area Name... from the right mouse button menu. This will bring up the Area Name dialog box where you can enter any name you wish.
You can also name a cell or area by selecting it then typing the name into the small text box at the left end of the Formula toolbar, overwriting the cell reference that normally appears here.
If you enter a name that has already been used into this text box KSpread's selection will change to show the named cell(s).
The Data->Show Area... option will give you a list of existing names and let you change KSpread's focus to any of them or let you remove a name.
Named cells are particularly useful in formulae as an alternative to absolute cell references as the names can be used in place of normal cell references and do not change when the cell containing the formula is copied. When a name is used in this way it should be enclosed in single quotation marks.
For example, if cell A1 has been given the name fred then you can enter a formula such as ='fred' + 2 into another cell which would always give the result of adding 2 to the value in A1 no matter where the formula cell was copied to.
Note that cell and area names are treated as being in lower case.
A cell can contain a text comment that can be viewed when working on the spreadsheet but which is not printed and not normally seen.
To add a comment select the cell and choose Add/modify comment... from the right mouse button menu or from the Insert-> Comment menu and type your comment into the resulting Cell Comment dialog box.
To see the comment hover the mouse pointer over the top right corner of the cell. The comment will appear as if it were a Tooltip.
If you check the Show comment indicator box of the Misc page in the Settings->Configure KSpread... dialog, those cells containing comments will be highlighted by a small red triangle in the top right corner.
To remove a comment from a cell, select Remove Comment from the right mouse button menu or choose Edit->Clear->Comment.
KSpread has a limited ability to import (read) and export (write) spreadsheet files with foreign formats. KSpread's capabilities at the time of writing are summarized in the table below, for more up to date information visit http://www.koffice.org/filters/status.phtml.
| Format | Import | Export |
|---|---|---|
| Applix Spreadsheet | Beta | None |
| Comma Separated Values (CSV ) | Good | Good |
| dBase | Beta | None |
| Excel 97/2000 | Good | None |
| Gnumeric | Beta | Beta |
| HTML | None | Beta |
| Quattro Pro | Beta | None |
To import a foreign file just load it as though it were a KSpread native file with File-> Open....
To export a KSpread file in a different format select File->Save As... and select the format from the Filter: drop down box. Although KSpread automatically adds a .ksp extension to the names of files saved in its native format, you should add the correct extension for foreign formats.
Tables of data are often held in text files with the values in a line being separated by a comma, space, tab or other character, for example 123, 456, 789, abcd, efgh. Such files are commonly called “CSV” (Comma Separated Values) files, even though the separating character may not be a comma.
If you ask KSpread to open a text file it assumes that the file is in CSV format and launches a dialog box that allows you to specify the delimiter (separating character) used by the file, and shows how the data items will be placed into different spreadsheet cells.
Other options in this dialog box let you define the Format of the spreadsheet cells, whether text quote characters should be removed, and whether the first line(s) of the file should be ignored.
To change the shortcut key arrangements used by KSpread select Settings->Configure Shortcuts... . This will launch a dialog box as shown below.

Search through the combo box to find the action you want to add or change the shortcut keys for and select it by left clicking on the name. You will then be able to change the shortcut by selecting the None, Default or Custom radio button or by clicking on the large button in the Shortcut for Selected Action area.
The Define Shortcut dialog box will then open.

Choose whether you want to change the Primary or Alternate shortcut then press the key combination you want to act as the shortcut, for example Ctrl+Shift+S. If the Auto-Close box is checked the dialog will vanish as soon as you enter the key combination, otherwise it will remain until you press OK or Cancel. Clicking on the little black icon with a white cross in it clears the shortcut.
You can add your own pop up menu to KSpread so that pressing one key combination will make the menu appear then pressing a second key, or using the Up arrow and Down arrow keys and pressing Enter, will select an item from it.
To do this add a Custom shortcut for each of the actions you want to appear in the menu and in the Define Shortcut dialog check the Multi-Key box, press the key combination that you want to bring up your new menu then, separately, press the key that will choose that item from the menu.
KSpread has five toolbars; File, Edit, Math, Format and Color/Border, each of which may or may not be shown depending on the choices made in the Settings menu.
You can choose whether a toolbar appears at the top, left, right or bottom of KSpread's window by right clicking on the toolbar, which brings up the Toolbar Menu, and making a selection from the Orientation sub menu. This Toolbar Menu also has sub menus for choosing whether the toolbar displays icons, text or both, and the size of the icons.
Another way of moving a toolbar is by positioning the mouse pointer over the two vertical bars at the left end of each toolbar and holding the left mouse button down while you drag the toolbar to the wanted position. When you drag the toolbar in this way you can release the mouse button when it is some distance from any of KSpread's window sides, and then you will get a floating toolbar, which is not locked to any particular part of KSpread's window and can in fact be moved outside of the window. To put a floating toolbar back into one of the traditional positions right click on the its title bar to bring up the Toolbar Menu then choose one of the options in the Orientation sub menu.
You can also “flatten” a toolbar by left clicking on the two vertical bars at the left end of the toolbar or by selecting Orientation->Flat from the Toolbar Menu. A “flattened” toolbar appears as a small rectangle containing two horizontal bars just under KSpread's Menubar. It can be restored to normal by left clicking on it.
Selecting Configure Toolbars... from the Settings menu will bring up a dialog box which lets you add buttons to or remove them from KSpread's toolbars.
To use this Configure Toolbars dialog box first select a toolbar from the Toolbar: drop down list. The right hand Current actions: window will then show the buttons currently present on the toolbar. You can remove a button by selecting it in this window then pressing the left arrow button, or move it around by pressing the up and down arrow buttons. To add a new button to the toolbar select it in the Available actions: list then press the right arrow button.
Selecting Settings-> Configure Kspread... opens a dialog box with several pages, selected with the icons at the left of the dialog box, which allow you to change many aspects of KSpread's operation.
This page has a number of checkboxes which control how items are displayed, entered or calculated:
If this box is checked KSpread will display the actual formulae in cells rather than the results.
If this box is checked KSpread will display a small blue triangle at the bottom left corner of cells containing formulae.
Controls whether or not the sheet grid lines are shown.
If this box is checked the column headings will show as numbers rather than as letters.
If this box is checked the cell reference shown at the left end of the Formula Bar will be displayed in LC mode (i.e. L2C3) rather than in its normal form B3. This does not seem to be of much use at the moment.
Controls whether formulae are recalculated automatically when the value of any cell they refer to changes.
If this box is checked any cell containing the value zero will appear blank.
Check this box and the first letter of any text you type in will automatically be converted to upper case.
This page of KSpread's configuration dialog box shows how items such as numbers, date, time and money are displayed.
If you have loaded a spreadsheet that was generated using a different locale, then pressing the Update to Locale System button on this page will update it to conform to your locale settings.
This page of KSpread's configuration dialog box (obtained by selecting Configure Kspread... from the Settings menu) controls some more KSpread features:
Controls how many worksheets will be created if the option Start with an empty document is chosen when KSpread is started.
Controls the maximum number of filenames that are shown when you select File-> Open Recent.
Here you can select the time between autosaves, or disable this feature alltogether by choosing No auto save.
Check or uncheck this box to show or hide the vertical scrollbar.
Check or uncheck this box to show or hide the horizontal scrollbar.
Check this box to show the column letters across the top of a worksheet.
Check this box to show the row numbers down the left side.
This checkbox controls whether the sheet tabs are shown at the bottom of the worksheet.
Here is where you can choose to show or hide the Formula bar.
Uncheck this box if you do not want the Statusbar to appear.
The Misc page of KSpread's configuration dialog box contains the following items;
Lets you choose the (auto) text completion mode from a range of options in the drop down selection box.
Lets you define the amount of indenting used by the Increase indent option in the Format menu.
When you have selected a cell then press the Enter key the selection will move one place to the left, right, up or down as determined by the setting in this drop down selection box.
If this box is checked a message box will pop up when what you have entered into a cell cannot be understood by KSpread.
This drop down selection box can be used to choose the calculation performed by the Statusbar Summary function..
If this box is checked cells containing comments will be marked by a small red triangle at the top right corner.
This page of KSpread's configuration dialog box lets you choose the color of the sheet grid. If you do not want the grid to appear at all uncheck the Show grid box in the Preferences configuration page.
This page also lets you select the color of the lines used to indicate the printed page borders when the Show Page Borders box in the View menu is checked.
This page lets you configure the behavior of KSpread's spelling checker.
If this box is checked then when KSpread finds a word in the document which it does not recognize but which consists of a recognized root word plus a recognized prefix or suffix it will accept it, whereas if the box is not checked the spelling checker will reject it.
If this box is checked then common words which are run together will be considered to be spelling errors, for example cannot.
This drop down selection box can be used to select alternative dictionaries.
To select the character encoding that should be used.
This dropdown box lets you select between different spell checking programs that may be present on your computer.
Check this box if you want the spellchecker to ignore uppercase words, which are usually acronyms such as KDE.
Create a new document.
Open an existing document.
Open an existing document by selecting it from a drop down list of recently used files.
Save the document.
Save the document with a new name or format.
Create a KSpread template based on this document.
Print the document.
View the document as it will be printed.
View or enter information about the document and author.
Send the file as an email attachment.
Close the current document but leave KSpread running.
Quit KSpread.
Undo the last action.
Redo the last undone action.
Put selected item(s) into the clipboard. If you then do a Paste the item(s) will be moved from the original location to the new one.
Copy selected item(s) to the clipboard.
Paste item(s) from the clipboard to the selected cell(s).
Special forms of Paste. See the sections Other Paste Modes and Arithmetic using Special Paste for more details.
Find cell containing given text.
Find and replace given text in cell(s).
Clear text, Comment, Validity or Conditional Cell Attributes from selected cell(s).
Delete everything from selected cell(s).
Add or modify conditional cell attributes.
Set or modify the error checking criteria and error alert message for selected cell(s). See Validity Checking for more details.
To modify selected cell in-situ.
Open a new instance of KSpread.
Close all open instances of KSpread.
Split current view into two parts.
Remove current view. (Where the window contains two or more views)
Change view split to horizontal or vertical.
Change KSpread's focus to show defined cell.
Toggle marking of printed page borders in the sheet with red lines.
Increase or decrease the magnification used to display the spreadsheet.
Add another worksheet.
Add, modify or remove cell comment.
Insert a mathematical function. See the section Formulae for more details.
Insert a series. See the section Series for more details.
Insert a link into the selected cell. See the section Link Cells for more details.
This feature is not yet fully implemented.
Insert a chart. See the section Inserting a Chart for more details.
Insert data from a text file, database or from the clipboard. See the section Inserting External Data for more details.
Format selected cell(s). See the Spreadsheet Formatting section for more details.
Format printed page layout.
Define or reset the print range.
Remove, hide or show worksheet.
Set row and column sizes to show selected cell(s) properly.
Resize, equalize, hide or show row(s).
Resize, equalize, hide or show column(s).
Set default format for selected cell(s).
Set percent format for selected cell(s).
Increase displayed precision of numbers in selected cell(s).
Decrease displayed precision of numbers in selected cell(s).
Set money format for selected cell(s).
Move text in selected cell(s) to the right.
Move text in selected cell(s) to the left.
Change angle of displayed text in selected cell(s).
Sort data in selected cells. See the section Sorting Data for more details.
Sort data in selected cells so that values are in increasing order.
Sort data in selected cells so that values are in decreasing order.
Insert new column(s) at left of selected column(s).
Insert new row(s) above selected row(s).
Delete selected column(s).
Delete selected row(s).
Insert new cell(s).
Remove selected cell(s).
Merge selected cells.
Dissociate (split apart) previously merged cells.
Change KSpread's focus to show a previously named area. See the section Named Cells and Areas for further details.
Open the Goal Seek dialog box. See Goal Seeking for details.
Consolidate data. See the section Consolidating Data for more details.
This option attempts to interpret text in the selected cell(s) as CSV data, placing each item into a different cell in the row.
Check spelling of words in the worksheet.
View or amend the special series of words recognized by KSpread.
Recalculate formulae in the current sheet.
Recalculate all sheets.
Open an instance of the desktop calculator KCalc.
Show or hide the File toolbar.
Show or hide the Edit toolbar.
Show or hide the Math toolbar.
Show or hide the Format toolbar.
Show or hide the Color/Border toolbar.
Configure the keyboard shortcuts used by KSpread. See the section on configuring shortcuts for more details.
Configure the toolbars. The section on configuring toolbars has more information.
General KSpread configuration. See the section on KSpread configuration for more details.
Invokes the KDE Help system starting at the KSpread help pages. (this document).
Changes the mouse cursor to a combination arrow and question mark. Clicking on items within KSpread will open a help window (if one exists for the particular item) explaining the item's function.
Opens the Bug report dialog where you can report a bug or request a “wishlist” feature.
This will display version and author information.
This displays the KDE version and other basic information.
This section describes the items in the pop up menu obtained by right clicking on a selected cell or cells, row(s) or column(s).
Format selected cell(s). See the Spreadsheet Formatting section for more details.
Put selected item(s) into the clipboard. If you then do a Paste the item(s) will be moved from the original location to the new one.
Copy selected item(s) into the clipboard.
Paste item(s) from the clipboard to the selected cells.
Special forms of Paste. See the sections Other Paste Modes and Arithmetic using Special Paste for more details.
Paste from the clipboard to the selected cell(s), moving the previous cell(s) to make room.
Delete contents of selected cell(s).
Change size of row and column to display selected cell(s) completely.
Change height of selected row.
Change height of selected row to display cell(s) completely.
Change width of selected column.
Change width of selected column to display cell(s) completely.
Set default formats for selected cell(s).
Name selected area. See the section Named Areas for more details.
Insert new cell(s) at selected location, moving existing cell(s) to make room.
Remove selected cell(s), moving other cell(s) to occupy the space left by the removed cell(s).
Add or modify a comment to the selected cell.
Opens the Related Words dialog box.
This section describes those KSpread shortcut keys used for operations that do not appear in any of the menues.
If the selected cell is occupied then move the selection to the start or end of the occupied block in the current row or column. If the selected cell is not occupied then move the selection to the start or end of the block of unoccupied cells in the current row or column.
If the selected cell is occupied then select all occupied cells to the start or end of that block of ocupied cells in the current row or column. If the selected cell is not occupied then select all unoccupied cells to the start or end of that block of unoccupied cells in the current row or column.
Move the selection 10 cells down.
Move the selection 10 cells up.
Move to the next sheet.
Move to the previous sheet.
Change cell reference between normal and absolute reference types.
Add a border to the selected cell(s).
Display the value of the selected cell(s) in Money format.
Display the value of the selected cell(s) in Percentage format.
Display the value of the selected cell(s) in Scientific format.
Display the value of the selected cell(s) in Date format. The value is taken as the number of days since 1 January 1900.
Display the value of the selected cell(s) in Time format. The value is taken as the number of seconds since midnight.
Display the value of the selected cell(s) in normal Number format.
KSpread
Program copyright 1998-2002 The KSpread Team:
Torben Weis <weis@kde.org>
Laurent Montel <lmontel@mandrakesoft.com>
David Faure <faure@kde.org>
John Dailey <dailey@vt.edu>
Philipp Müller <philipp.mueller@gmx.de>
Ariya Hidayat <ariya@kde.org>
Norbert Andres <nandres@web.de>
Shaheed Haque <srhaque@iee.org>
Werner Trobin <trobin@kde.org>
Nikolas Zimmerman <wildfox@kde.org>
Helge Deller <deller@gmx.de>
Percy Leonhart <percy@eris23.org>
Eva Brucherseifer <eva@kde.org>
Phillip Ezolt <phillipezolt@hotmail.com>
Enno Bartels <ebartels@nwn.de>
Graham Short <grahshrt@netscape.net>
Documentation copyright 2002 Pamela Roberts <pamroberts@blueyonder.co.uk>
This documentation is licensed under the terms of the GNU Free Documentation License.
This program is licensed under the terms of the GNU General Public License.
KSpread is part of the KDE's KOffice package and uses various KOffice libraries. KOffice itself is part of and depends on the general KDE libraries.
For instructions on acquiring and installing KDE, KOffice and KSpread please visit http://www.kde.org and http://www.koffice.org.