Combining AND and OR functions

M

MZ

Where would the "OR" go in the following function:

Cell A1 can be Yes or No
Cell A2 can be any number
Cell A3 can be any number

If EITHER Cell A1 is "Yes" OR Cell A2 is equal to or above 50 AND Cell A3 is
equal to or above 100, then return "OK";
however, if cell A1 is "No" AND either A2 is below 50 or A3 is below 100,
then return "No good"

=IF(AND(A2>=50,A3>=100),"OK","No good")

How would I add the OR term to test whether A1 is Yes or No?
 
J

Joe User

MZ said:
If EITHER Cell A1 is "Yes" OR Cell A2 is equal
to or above 50 AND Cell A3 is equal to or above
100, then return "OK";
however, if cell A1 is "No" AND either A2 is
below 50 or A3 is below 100, then return "No good"

=IF(OR(A1="yes",AND(A2>=50,A3>=100)), "OK", "No good")

Alternatively:

=IF((A1="yes")+(A2>=50)*(A3>=100), "OK", "No good")

I would use the latter (less clear, IMHO) only if the function nesting limit
(7 before Excel 2007) becomes a problem.


----- original message -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top