AND/OR FUNCTION

Hi,
Can you please help with AND/OR function
LOGIC
IF A1 = abcd  AND B1 = blue  then 99
OR
IF A1 = abcd AND B2 = yellow then 99
otherwise zero  
Many thanks
Ian
Ian BellretiredAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saqib Husain, SyedEngineerCommented:
=if(and(A1="abcd",or(b1="blue",b2="yellow")),99,0)
0
Ian BellretiredAuthor Commented:
Thanks Saqib
If I wanted to return 99 if A1 =abcd and B1 <> blue  OR   B1 <> yellow
how would the formula look ?
* no B2 cell this time.
0
Saqib Husain, SyedEngineerCommented:
Just change b2 to b1

=if(and(A1="abcd",or(b1="blue",b1="yellow")),99,0)
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

Ian BellretiredAuthor Commented:
I was wanting it to return 99 only if b1 did not contain "blue" or "yellow" and zero if contained blue or yellow........ A1 should always be abcd
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Hi Ian,

Maybe you need this...

=IF(AND(A1="abcd",B1<>"blue",B1<>"yellow"),99,0)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ian BellretiredAuthor Commented:
I did change the question from = to <> so apologies for that.
Thanks to both of you.
Ian
1
Ian BellretiredAuthor Commented:
I was trying to place the OR function and that is where I got into a mess.
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Ian. Glad it worked as desired in the end. :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.