On Fri, 2005-02-04 at 23:22 -0600, Peter Kupfer wrote:
javier wrote:
I'm stuck with quite a stupid question.
I'm working in writer with a table with calculations. I wan't a cell to display a value only if it's positive and 0 when the value is negative. In calc, this formula work all right:
=IF(A1>A2;A1-A2;0)
but in writer
=IF(<A1>><A2>;<A1>-<A2>;0)
doesn't work. It always return the failed result (0). And the reverse condition <A1><<A2> can't be checked (it returns an error, probably it sees the "<" sign as the start of a cell reference).
Any idea of a workaround? Should I file an Issue?.
Try =IF(<A1>g<A2>;<A1>-<A2>;0)
The g is the writer table command for greater than. This was listed in the help. You may want to check there in the future. Search for "greater table" than click *formula*. This will also get you a list of all of the Writer table functions.
Also, if you press *F2* while in a table cell, you will get the formula bar.
However, I don't see any reference in the help for the IF statement.
In preparing the user guide, I din not find any reference to IF either when dealing with tables or fields. The IF is implied by braketing. Sort of like using brackets in /bin/sh to show the use of test().
I wouldn't mind doing this, but I am stuck.
Do you know where to start with this. I have been searching in Google for quite some time now. I can run a simple if x > y and get a result, but, how do you do a if then statement besides that.
I made a table with A1 = 6 & A2 = 8.
Here are my test cases:
*Test #* *I enter* *I get* 1a =<A1>g<A2> 0 2a =<A1>g<A2>;<A1>-<A2> -2 3a =<A1>g<A2>;0;<A1>-<A2> -2 4a =<A1>g<A2>;<A1>-<A2>;0 0
Now, I change A1 = 8 & A2 = 6 *Test #* *I enter* *I get* 1b =<A1>g<A2> 1 2b =<A1>g<A2>;<A1>-<A2> 2 3b =<A1>g<A2>;0;<A1>-<A2> 2 4b =<A1>g<A2>;<A1>-<A2>;0 0
So, in case 1a & 1b, it makes sense. However 2a shouldn't yield -2, I don't think. Between 3a & 4a, it seems that the table just returns the value that is last in the formula. This seems consistent in 3b & 4b. Writer seems to ignore the conditional statement entirely.
Anyone know how to address this?
-- Peter Kupfer OOo user since 'OO4 http://peschtra.tripod.com/open_office/ooo_front.htm
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
