[Solved] If this then that issue

Discuss the spreadsheet application
Post Reply
hacketm
Posts: 6
Joined: Sun Feb 18, 2018 9:52 pm

[Solved] If this then that issue

Post by hacketm »

Hi, I`m trying to get a formula correct.

What i`m trying to do is, if (O3=false then Y3= -1.5 * N3), If O3=True, Then Y3 =.60
Am I far off with =IF(O3="False");Y3=(1.5*N3),;If(O3="True");Y3,.60))

Thank you in advance.
Last edited by Hagar Delest on Wed Feb 21, 2018 11:34 pm, edited 1 time in total.
Reason: tagged [Solved].
Open Office 4.1.5
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: If this then that issue

Post by RoryOF »

You should only need one IF statement; the syntax is IF(Test;Then _value;Otherwise_value)
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
hacketm
Posts: 6
Joined: Sun Feb 18, 2018 9:52 pm

Re: If this then that issue

Post by hacketm »

Even with the second "if" out I`m getting a 508 error
Open Office 4.1.5
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: If this then that issue

Post by RoryOF »

in Calc Help look up ### error message (hint: missing bracket)
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
hacketm
Posts: 6
Joined: Sun Feb 18, 2018 9:52 pm

Re: If this then that issue

Post by hacketm »

Am I far off with the following

=IF(O3="False");Y3=(-1.5*N3),;(O3="True");Y3,.60)))
Open Office 4.1.5
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: If this then that issue

Post by RoryOF »

Count your start and your closing brackets. You want to do this - you have to learn to write the expression.
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: If this then that issue

Post by Lupp »

Did you ever read anything about using Calc (or any spreadsheet software)?

You cannot assign results to arbitrary cells by formulae. If you want to assign the result to cell Y3, you need to put the formula into cell Y3. Boolean values are simply used as test results. You don't need to compare them with anything. If O3 is Boolean (logical) and gives a test result, using it in the place of the condition in the IF() function, automatically applies the else-case if the condition came out FALSE.

Code: Select all

=IF(O3;0.60;1.5*N3)
placed in Y3 should be appropriate.
Last edited by Lupp on Sun Feb 18, 2018 11:02 pm, edited 1 time in total.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
hacketm
Posts: 6
Joined: Sun Feb 18, 2018 9:52 pm

Re: If this then that issue

Post by hacketm »

I`m new to all of this, That worked, Thank you for the help
Open Office 4.1.5
User avatar
robleyd
Moderator
Posts: 5086
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: If this then that issue

Post by robleyd »

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
Post Reply