AND/OR FUNCTION

Ian Bell
Ian Bell used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
=if(and(A1="abcd",or(b1="blue",b2="yellow")),99,0)
Ian Bellretired

Author

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.
Just change b2 to b1

=if(and(A1="abcd",or(b1="blue",b1="yellow")),99,0)
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Ian Bellretired

Author

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
Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015
Commented:
Hi Ian,

Maybe you need this...

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

Open in new window

Ian Bellretired

Author

Commented:
I did change the question from = to <> so apologies for that.
Thanks to both of you.
Ian
Ian Bellretired

Author

Commented:
I was trying to place the OR function and that is where I got into a mess.
Subodh Tiwari (Neeraj)Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015

Commented:
You're welcome Ian. Glad it worked as desired in the end. :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial