« Manually Controlling What's In Your Labels, in OpenOffice Writer (Repost) | Main | The Microsoft Office 2007 Upgrade Is Going to Have a Big Learning Curve--and a Big Price. Now's the Time to Consider OpenOffice.org Instead. »

July 19, 2006

Doing Calculations in Tables, in OpenOffice Writer (Repost)

(First posted February 2006)

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/4219149

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

Comments

Dear Solveig,

Thanks for this tip - I'm finding it useful just at this very moment. However, like you, "I personally prefer to use spreadsheets, so I would do the calculations in a spreadsheet and then just copy and paste". Yet when I try to do this from Calc to Write, it just pastes the cells as an image rather than a table. I can stretch and skew the image but can't manipulate the table as such. Any ideas? I hope this isn't too dumb a question.

I'm using OpenOffice under Windows XP.

Thanks,

John

Hi John,

There are no dumb questions! Good point. To manipulate the pasted spreadsheet in a Writer doc, click and/or double-click the spreadsheet. (I find it varies, either that or my memory is slipping. ;> ) Then the toolbars change and you get the Calc toolbars. Select the cells or click in them to do what you want, then click back in the main part of the Writer doc to get out again.

Post a comment