« Google and Dell Billion Dollar Deal | Main | Louis Suarez-Potts Wants Sun to Let OpenOffice.org Go: Corrected »

February 08, 2006

Doing Calculations in Tables, in OpenOffice Writer

Doing calculations in tables is a nice feature of OpenOffice.org Writer. You can essentially treat a table like a spreadsheet. With this example, for instance, I can just use spreadsheet-like calculations in the table to get the totals and differences.

Tcalc1

The process is a bit different in 2.0 so I'm blogging it here; plus anyone who hasn't used the feature before can see if they like it.

Note: I personally prefer to use spreadsheets, so I would do the calculations in a spreadsheet and then just copy and paste. But for those who like tables, here's how you do it.

This process focuses on summing, with some other options.

First, of course, create the table the way you want it.

Then click in the empty cell where you want a calculation. Choose Table > Formula or press F2 and you'll get the spreadsheet-like toolbar with the formula entry field.

Tcalc2

If you know what you want and just want to go right ahead and do it, just type what you want using <> around each cell reference. <F5>, <A1>, etc.

If you want some help from the system, do it this way. Select the cells you want to calculate; you'll get an addition formula by default. This will sum the contents of the selected cell range.

Tcalc3

If it's what you want, press Enter or click the green arrow by the formula field. The total will appear.

Tcalc4

If it isn't what you want, just retype the formula in the formula field. Be sure to preserve the syntax with the <> around each cell reference. Cell references are the same as Calc, with A1 being the upper left cell of a table and counting across to B and down to 2, and so on. A correct subtraction formula for instance is =<b2>-<c2>

In the following example, I of course want to find the difference, not the sum, of the expenses and income, so I changed the formula.

Tcalc5

If you want something more complicated than addition, subtraction, multiplication, and division, click on the formula dropdown list.

Functiondropdown

To format the cells automatically with dollar signs, etc.. select the cells, right click, and choose Number Format. In the window that appears, select the format you want. Click the following image to see a larger image of the window, if you want.

Numberformat_1 

Overall, the table formulas work but they're just a bit twitchy. If you've got something beyond simple math, I suggest doing it in a spreadsheet, then copying and pasting the spreadsheet into Writer.



TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/551685/5242842

Listed below are links to weblogs that reference Doing Calculations in Tables, in OpenOffice Writer :

Comments

If my table have some cells merged, will calculation work ? How can I identify lines and columns ?
Thanks

Anyone know how to prevent zero values from displaying in Writer using tables? I have a table working out totals from quantity and unit price columns, but only want the formula to display if the quantity is greater than 0. Any ideas if this is possible in Writer, or will I have to use Calc?

Yes but is there a way to calculate the value for en entire column?

Hi Sanguis,

You just have to put in the range, like A1 to A56.

Solveig

Post a comment