[Solved] Operator for value lower than negative value?

Discuss the spreadsheet application
Post Reply
withnail
Posts: 69
Joined: Fri Feb 15, 2019 10:57 pm

[Solved] Operator for value lower than negative value?

Post by withnail »

Hi,

I have a column with negative numbers that gradually increase, like so....

-1
-14
-56
-190
-334
-576
-798

When a cell reaches a negative value of more than -600 (so from -601 onwards) I want the formula to then perform a different function.
I can't seem to find an operator which allows me to do this.
All I can get to work is under zero ("<0"), if I try <-600 or <=-600 it won't work....what am I doing wrong?!
Last edited by withnail on Sat Jun 22, 2019 8:36 pm, edited 1 time in total.
OpenOffice 4.1.7
Windows 10
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Which operator for value lower than another negative val

Post by FJCC »

Using < -600 should work. Without seeing your actual formula, it is hard to say what is going on. Please show your formula and explain what result you are getting and what result you expect.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
withnail
Posts: 69
Joined: Fri Feb 15, 2019 10:57 pm

Re: Which operator for value lower than another negative val

Post by withnail »

Oh and these are my formula-

=IF(I4<0,1.053*( (-I4+$E$3) / (A5-1) ),IF(I4<=-600,$E$3))

=IF(I5<0,1.0526*(-I4+$E$3),IF(I4<=-600,1.053*$E$3))
OpenOffice 4.1.7
Windows 10
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Which operator for value lower than another negative val

Post by RoryOF »

-600 is greater than -601; you need to rethink - your list of negative number gradually decreases.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Which operator for value lower than another negative val

Post by Lupp »

@whitenail:
Did you notice that you formulas contain the comma as the list separator between parameters?
Your signature claims you are using AOO. This would never work.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
withnail
Posts: 69
Joined: Fri Feb 15, 2019 10:57 pm

Re: Which operator for value lower than another negative val

Post by withnail »

Sorry, I'm using LibreOffice, thought it was the same...
OpenOffice 4.1.7
Windows 10
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Which operator for value lower than another negative val

Post by FJCC »

Code: Select all

=IF(I4<0,1.053*( (-I4+$E$3) / (A5-1) ),IF(I4<=-600,$E$3))
Let's say that I4 = -605. The formula will calculate

Code: Select all

1.053*( (-I4+$E$3) / (A5-1) )
because I4 is less than zero. It will never evaluate the I4 <= -600 condition because I4 <0 is TRUE. If you reorder the formula so that I4 <= -600 comes first, then you may get what you want.

Code: Select all

=IF(I4 <= -600, $E$3, 1.053*( (-I4+$E$3) / (A5-1)))
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
withnail
Posts: 69
Joined: Fri Feb 15, 2019 10:57 pm

Re: Which operator for value lower than another negative val

Post by withnail »

FJCC wrote:

Code: Select all

=IF(I4<0,1.053*( (-I4+$E$3) / (A5-1) ),IF(I4<=-600,$E$3))
Let's say that I4 = -605. The formula will calculate

Code: Select all

1.053*( (-I4+$E$3) / (A5-1) )
because I4 is less than zero. It will never evaluate the I4 <= -600 condition because I4 <0 is TRUE. If you reorder the formula so that I4 <= -600 comes first, then you may get what you want.

Code: Select all

=IF(I4 <= -600, $E$3, 1.053*( (-I4+$E$3) / (A5-1)))
Thank you, it works perfectly now! :-)
OpenOffice 4.1.7
Windows 10
User avatar
robleyd
Moderator
Posts: 5087
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Which operator for value lower than another negative val

Post by robleyd »

withnail wrote:Sorry, I'm using LibreOffice, thought it was the same...
Not exactly; there are differences which matter when providing advice, such as the situation Lupp mentions about separators. LO Calc also has some functions not (yet) available in AOO.

Please consider updating your signature to reflect what you are actually using so we can better advise you.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
withnail
Posts: 69
Joined: Fri Feb 15, 2019 10:57 pm

Re: Which operator for value lower than another negative val

Post by withnail »

robleyd wrote:
withnail wrote:Sorry, I'm using LibreOffice, thought it was the same...
Not exactly; there are differences which matter when providing advice, such as the situation Lupp mentions about separators. LO Calc also has some functions not (yet) available in AOO.

Please consider updating your signature to reflect what you are actually using so we can better advise you.

Done :-)
OpenOffice 4.1.7
Windows 10
Post Reply