John Jason Jordan - johnjas...@gmail.com wrote:
OOo 3.3.0 downloaded from Openoffice.org on Fedora 14, x86_64.

I have a simple table in Writer where I want to do some elementary
math. The table lists stocks, where the second column (B) is the number
of shares, the third column (C) is the basis (price paid), the fourth
column (D) is the current price. In the fifth column (E) I want a
formula that calculates D minus C times B, that is, to show how much
gain or loss there has been. In the last column (F) I want to calculate
the total value based on current price, that is, B times C. Here is the
first line as an example:

A               B       C               D               E       F
AGCO    200     43.20   41.25   0.00    0.00

A spreadsheet would be more appropriate for this, unless there is a specific reason you want this embedded in a Writer document.

The formula that I used in E is =sum(D1-C1)*B1. The formula does not
generate any error messages, but as you can see, it thinks the answer
is 0.00, where it should be -390.00. The formula that I used for F is
=sum(B1*D1), but it also displays 0.00 where it should be 8,250.00.

In writer, it appears the cell references need to be surrounded in angle brackets, i.e. for E use =(<D1>-<C1>)*B1 and for F use =<B1>*<D1>. The sum() function is not needed in this case - it is useful if you have a range of cells whose values you want to add, e.g. =sum(<A1:A5>).

All columns except A are set to general number format.

I can't figure out why the formulas do not calculate the correct
answers. Any help is welcome.

Hope that helps.

Mark.

--
-----------------------------------------------------------------
To unsubscribe send email to users-unsubscr...@openoffice.org
For additional commands send email to sy...@openoffice.org
with Subject: help

Reply via email to