[Solved] If statement

Discuss the spreadsheet application
Post Reply
patton228
Posts: 16
Joined: Tue Feb 21, 2017 6:21 am

[Solved] If statement

Post by patton228 »

Can someone please help me correct this?

IF(AND(B18=6; B18=5;SUM(B14:B16)+SUM(J58:J67);0))

The result keeps showing false no matter what, Thanks
Last edited by patton228 on Thu Nov 23, 2017 8:22 am, edited 3 times in total.
apache openOffice 4.1.3
windows 10
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: If statement

Post by robleyd »

AND returns TRUE if all arguments are TRUE. If one of the elements is FALSE, this function returns the FALSE value. B18 can't have both values 5 and 6 at the same time, so AND will return FALSE.

Perhaps if you explain what you are trying to achieve, perhaps with as sample spreadsheet demonstrating your data etc. we might be able to offer more advice.

[Forum] How to attach a document here Note maximum file size is 128K. If your file is larger, use a file sharing site such as Mediafire. The link also contains information on how to anonymise your document if it contains confidential information.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
patton228
Posts: 16
Joined: Tue Feb 21, 2017 6:21 am

Re: If statement

Post by patton228 »

Height of fence = B18

If height of fence is 5 or 6 (feet)
SUM(B14:B16)+SUM(J58:J67

else show 0 (zero)

Hope this helps if not I will process my spreadsheet here.
apache openOffice 4.1.3
windows 10
patton228
Posts: 16
Joined: Tue Feb 21, 2017 6:21 am

Re: If statement

Post by patton228 »

Wasn't sure if I could use OR instead.
apache openOffice 4.1.3
windows 10
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: If statement

Post by robleyd »

patton228 wrote:Wasn't sure if I could use OR instead.
What happens if you use OR ??

Spoiler - it appears to be what you need based on your second post.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
patton228
Posts: 16
Joined: Tue Feb 21, 2017 6:21 am

Re: If statement

Post by patton228 »

Ok thank you, I think I worked a way around that I have a new problem.

What I'm trying to do is:

I enter board width in B19 then:

M67:M69 gives me a sum of boards which adds it to my list B64:B66

For instance if I input board width 5.5 @ cell B19 I don't want M67 or M69 to show up at b64 and b66 cause it will show up in my material list
and vise versa for all three inputs, whichever input I put in at B19 I need it to cancel out whichever 2 cells between M67;M69 that I didn't choose.

I am stumped
Attachments
Horozontal Privacy fence help 2.ods
(24.79 KiB) Downloaded 87 times
apache openOffice 4.1.3
windows 10
patton228
Posts: 16
Joined: Tue Feb 21, 2017 6:21 am

Re: If statement

Post by patton228 »

Also how I worked out the problem you were helping me with the table in d72 is how I worked out that problem, it seems that's the only way I can get multiple things to work as in the table at k97 the gates.
apache openOffice 4.1.3
windows 10
patton228
Posts: 16
Joined: Tue Feb 21, 2017 6:21 am

Re: If statement

Post by patton228 »

Any Help?
apache openOffice 4.1.3
windows 10
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: If statement

Post by FJCC »

Would a formula like

Code: Select all

=IF(B19 = 3.5;SUM(H67:L67);0)
in M67 and similar formulas in M68 and M69 solve your problem?
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.
patton228
Posts: 16
Joined: Tue Feb 21, 2017 6:21 am

Re: If statement

Post by patton228 »

It would if there were only two variables, since B19 can be 3.5, 5.5, or 7.25, wasn’t sure if it’s possible, if anything I can make a sheet for 3.5, on for 5.5 and one for 7.5. I was reading about lookup and index and match, still reading how to do it, not even sure if it will work yet.
apache openOffice 4.1.3
windows 10
User avatar
keme
Volunteer
Posts: 3699
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: If statement

Post by keme »

Attached is your sheet, changed according to FJCC's suggestion. Could you explain why this doesn't do what you need?

A lookup will give a more generalized solution, easily extendable for other material dimensions.
Attachments
Horozontal Privacy fence help 2.ods
(29.39 KiB) Downloaded 126 times
patton228
Posts: 16
Joined: Tue Feb 21, 2017 6:21 am

Re: If statement

Post by patton228 »

Thanks so much, I guess I just couldn't visualize, It works ty very much.
apache openOffice 4.1.3
windows 10
Post Reply