<< Click to Display Table of Contents >> Table cells in calculations |
You can also use the cells in tables for calculations – similar to a spreadsheet!
If you are moving from cell to cell in a table, you should pay attention to the status bar at the bottom edge of the program window. This is where the coordinates of the current table cell are displayed.
The rows of a table are numbered 1, 2, 3, etc., by TextMaker; the columns are assigned the letters A, B, C, etc.
A1 |
B1 |
C1 |
... |
A2 |
B2 |
C2 |
... |
A3 |
B3 |
C3 |
... |
... |
... |
... |
... |
The first cell in the table thus has the coordinates "Column A" and "Line 1" or A1 for short.
To perform calculations within a table with the cell contents, choose the ribbon command Insert | group Text | Field | Calculation and enter the coordinates of the cell contents, led by a hash sign (#). For "Add the contents of cells A1 and A2", the correct formula would be:
#A1 + #A2
The # sign tells TextMaker that it should treat the content of the cell as a number. If the cell's content is to be treated as text, use the dollar sign ($) – for example, $A1.
Note that calculations such as #A1 + #A2 only work within the same table. If you want to add cells A1 and A2 outside this table, you have to put the table's name and a period in front of the cell address. So if the table is called "Table1", the correct formula would be as follows:
Table1.#A1 + Table1.#A2
For more information, see also Objects in calculations.
Calculating the sum of a range of table cells
The SUM function is especially useful for adding numbers in table cells. Simply enter the first and last desired cells as parameters, and TextMaker will add up the values in all cells of this range.
For example, you can use the formula SUM(#B2;#B5) to add the contents of cells B2 to B5.
Calculating with adjacent cells made easy
Tip: In some calculating functions (for example, SUM), you can also use symbolic cell references that represent all cells directly adjacent to a cell.
The following types of symbolic cell references are available:
▪ABOVE (represents the cells above the current cell)
▪BELOW (represents the cells below the current cell)
▪LEFT (represents the cells to the left of the current cell)
▪RIGHT (represents the cells to the right of the current cell)
For example, the formula SUM(ABOVE) calculates the sum of the cells directly above a cell.
Only those neighbors of the current cell that contain a number are taken into account. In other words, the automatically determined range extends from the current cell to the next cell without a number.
The following functions support symbolic cell references:
AVG, COUNT, MIN, MAX, PROD, SUM
For descriptions of all computational functions, see Computational functions.