[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 90
  • Last Modified:

Excel Formula

=IF(OR(A2="Yes",IF(B2="Open",B2="Book",IF(C2="Yes",IF(D2=0,D2=1)))),"Y","N")

so

   a          b             c         d
Yes      Open   YES         0

then the answer in e should be Y

a         b             c         d
Yes      Open   YES         7

Then the answer should be N

But they both return Y for me.

Your assistance is greatly appreciated.
0
Jagwarman
Asked:
Jagwarman
  • 2
  • 2
1 Solution
 
Saqib Husain, SyedEngineerCommented:
Can you explain in english what you want to achieve.

Till then try

=IF(A2="Yes",IF(B2="Open",IF(OR(D2=0,D2=1),"Y","N")))
0
 
Phillip BurtonCommented:
Two things.

1. It's because you are using:
=IF(OR - in order words, only one of the conditions needs to be true.

Secondly, I would suggest reducing the number of IFs:

=IF(AND(A2="Yes",B2="Open",C2="Yes",OR(D2=0,D2=1)),"Y","N")
0
 
JagwarmanAuthor Commented:
Gents

I think there is a piece missing from your solutions, either that or I am going completely mad

the query is:

If A2 =Yes and B2 = Open or Book and C2 = Yes and D2 =0 or 1 then the answer is Yes otherwise No

Thanks for your help with this
0
 
Phillip BurtonCommented:
=IF(AND(A2="Yes",or(B2="Open",B2="Book"),C2="Yes",OR(D2=0,D2=1)),"Y","N")
0
 
JagwarmanAuthor Commented:
How do you do that so quick Phillip. Brilliant thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now