Want to look at 2 columns and if 1st is >= 2nd then 1st minus 2nd, if 1st is < then 2nd minus 1st (either returning the result)
HOWEVER- it seems in a table, formulas like to use <> instead of ()?
here's what I have:
=IF (J2>=I2;J2-I2;IF J2<I2;I2-J2) but I get "Expression is faulty"
on Windows 10...any help greatly appreciated.
Thanks!
[Solved] "IF" formula in Writer table
[Solved] "IF" formula in Writer table
Last edited by MrProgrammer on Mon May 15, 2023 3:09 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Kube
OpenOffice 4.1.13
Windows 10 PRO
OpenOffice 4.1.13
Windows 10 PRO
Re: "IF" formula in a table using Writer
So you want the absolute (positive, or "unsigned") difference between the values?
You may want to consider embedding a spreadsheet object.
The IF() function you asked about is not available to Writer tables. Instead, you use a "boolean multiply" to apply conditions. The result of a compare is boolean TRUE or FALSE, numerically represented as 1 and 0, respectively.
In LibreOffice, Writer tables now support the ABS() function. In OpenOffice Writer you need a workaround.
One of several possible solutions:
You may want to consider embedding a spreadsheet object.
- Why use an embedded spreadsheet: Only a very limited set of functions are available to formulas in Writer tables.
- Why continue using a table: Referencing table values in other parts of your document is easier than extracting values from embedded objects.
The IF() function you asked about is not available to Writer tables. Instead, you use a "boolean multiply" to apply conditions. The result of a compare is boolean TRUE or FALSE, numerically represented as 1 and 0, respectively.
In LibreOffice, Writer tables now support the ABS() function. In OpenOffice Writer you need a workaround.
One of several possible solutions:
Code: Select all
=(<second> - <first>) * (1 - 2 * (<first> > <second>))
Re: "IF" formula in a table using Writer
Thanks! works fantastically.
is there a way to get it to denote a negative number?
for my purpose, column 1 is my count, column 2 is their count and would prefer it to be a positive result if my count is higher and a negative if not.
is there a way to get it to denote a negative number?
for my purpose, column 1 is my count, column 2 is their count and would prefer it to be a positive result if my count is higher and a negative if not.
Kube
OpenOffice 4.1.13
Windows 10 PRO
OpenOffice 4.1.13
Windows 10 PRO
Re: "IF" formula in a table using Writer
That would be a simple subtraction.
Code: Select all
=<A2> - <B2>
Last edited by keme on Mon May 15, 2023 3:15 pm, edited 1 time in total.
Re: "IF" formula in a table using Writer
Ahh.... I was overthinking it...
waas thinking of having to find the bigger number first THEN applying the negative after the operation....
It's a Monday
Thx again
waas thinking of having to find the bigger number first THEN applying the negative after the operation....
It's a Monday
Thx again
Kube
OpenOffice 4.1.13
Windows 10 PRO
OpenOffice 4.1.13
Windows 10 PRO