| View previous topic :: View next topic |
| Author |
Message |
Mark Guest
|
Posted: Thu Jan 29, 2004 9:22 am Post subject: Calculate min 0 |
|
|
Hi all,
i just try to calculate the following in a writer table:
Cell A1: x
Cell A2: y
Cell A3: if x-y is negative then 0 else x-y
Is there any Chance to get it ?
Thank a Lot
Mark |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
Posted: Thu Jan 29, 2004 9:43 am Post subject: |
|
|
enter this formula in A3 :
=IF(A1>A2;A1-A2;0) |
|
| Back to top |
|
 |
Mark Guest
|
Posted: Thu Jan 29, 2004 10:02 am Post subject: Works fine in Calc but nt in Writer |
|
|
Hi drench,
thanks a lot for your fast help.
This works fine in calc (german version with "Wenn" instead of "IF") but it's not working in the writer.
Any more idea ?
Thanks
Mark |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
Posted: Thu Jan 29, 2004 10:57 am Post subject: |
|
|
sorry about that, it is early in the morning!
I just put a calc table in the document when I want to do calculations, the syntax in writer formula is a bit inflexible. |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
Posted: Thu Jan 29, 2004 11:20 am Post subject: |
|
|
Try the formula
=(<A1> > <A2>)*(<A1>-<A2>)*-1
it produces the 'right' answer.
Now the big question WHY???
The first term results in 1 or 0 (true/false) ; the second term produces the difference; why does multiply those 2 in the formula result in a negative? |
|
| Back to top |
|
 |
Mark Guest
|
Posted: Thu Jan 29, 2004 11:59 am Post subject: Genius |
|
|
Hi dfrench,
that's a great idea !
But i don't think it's realy early - it's late here (21.00) and i'm still on work i must be crazy !
Thanks a lot.
The next time I can help i will do (I'm knew on oo, but i'm good in Hardware and Network).
I see - oo suport is much better than M$.
Cu
Mark |
|
| Back to top |
|
 |
|