# How to sum numbers from different tables in LibreOffice Writer

LibreOffice Writer can handle some of the very basic tools that are part of Calc (Microsoft’s LibreOffice version Excel) with its table function. To the exampleto sum the contents of several cells and write the total to a new cell, use the exact same formula “= total<[cellstart]:[cellfinish]>.

But what if you have multiple tables and need to insert math formulas with inputs from one table and results from another? For example, you have a table with the sales of one quarter and a second table with the sales from another quarter and want to combine these two sums in a third table? Well, in all fairness, you should probably be using Calc at this point. But if you don’t want to, there is an easy fix.

Here is a example of three tables in Writer. The first two tables contain sales for two separate quarters. For the third table, I want to combine the sums of the corresponding cells in the first and second tables. The sum formulas in the last column then give me the combined sums for both quarters.

The key here is one hidden property of every table: its name. LibreOffice Writer assigns each table a default name in ascending order when you insert the table. On this page the tables are named Table1, Table2 and Table3. For … sake example, let’s change these names to something more specific.

First, click View> Toolbars and make sure Table is checked. By default, the toolbar is docked at the bottom of the Writer window.

Now click anywhere in the first table to make it active, then click the Table Properties button (the one on the far right) on the toolbar.

In the “Table” tab, the first property is the table name. Therefore example, I’m going to change the names of my three tables to “FirstQ”, “SecondQ” and “Year”. Click OK to apply the changes.

Next, go to the third table and click cell B2. We want to combine the values ​​of the B2 cells in the FirstQ and SecondQ tables.

Enter “=” to start a formula. Notice that the cursor jumps to the formula toolbar at the top of the page.

Now you can start a formula like any other, but you have to use special syntax to get cells from other tables. To distinguish a particular cell as a cell from another table, enter the table name, a period, then the cell name and enclose the whole thing in angle brackets (the Less Than / Greater Than symbols). So for exampleTo insert the value of the B2 cell from our FirstQ table, let’s enter:

`<FirstQ.B2>`

With these table distinctions, you can do anything you would with a normal cell value. Since we want to add up the B2 cell values ​​from the first two tables, the overall formula is:

`=<FirstQ.B2>+<SecondQ.B2>`

Press Enter in the formula toolbar and the formula is applied to the table, which gives us the sum.

Here we have repeated this process for the entire third table and added the values ​​from the various cells in the first two tables. Notice that the formulas for the sums in the fifth column still work, even though these formulas (like = sum:) can only be applied to the third table itself.

Remember the table name, the period and. to add close the value with angle brackets, and you can use pretty much any formula available while calling values ​​from other tables. You can apply the table and cell in the formula toolbar automatically by clicking on it.