Writer: sum function on table

A follow up on the answer from

the sum function " = sum (B2:B4) " works fine, however, if a new row is made by pressing tab on the last cell, the sum function still stays the same, but the table has already 5 rows.

By inserting one new row in between B2 and B4, the B4 changes to B5.

But by adding a new row by pressing tab on the last cell, the B4 still stays B4, while there is already B5.

Is there a way that the sum function’s last row also changes as the number of rows increases?

The default for Calc (spreadsheet) is to not include the added row, this might be taken as a guide to expected practice in a Writer table.

There is a setting in Tools > Options > LibreOffice Calc > General to Expand references when new columns/rows are inserted which does what you want. You could enable it and insert a Calc sheet as an OLE object instead of using a Writer table.

Simply add another row between the data and the sum, and make that row have minimal height. Include that row into the sum range. You will have data expanded automatically as you add rows below last line of data (not “above totals row”!).You may remove vertical borders from the row (and have a nice-looking “double border” between data and the total), or you may remove even one of the horizontal borders from the row, too, to have a single border there, as elsewhere. I misremembered, and thought it was impossible to make the row to have height of 0, but have tested and sees that the row can be hidden completely.

You can report the problem as a bug.

How to Report Bugs in LibreOffice

But please remember that in Writer tables there are only very limited calculation possibilities.

You can also integrate a Calc table in Writer. This way you have all the possibilities of Calc in Writer. See:

Calc table in Writer

report the problem as a bug

… or, rather, an enhancement request (at the same location, setting Severity field of the issue accordingly).

1 Like