Nesting Functions

L

LostNFound

I want to use two criterias for an answer?? If Column A contains a 1 and
Column B says Yes then return a 1 But if column B is blank return 0.. Then at
the same time if column A contains anything >1 and Column B says Yes return a
2 but if column B is blank return zero


Thanks For any suggestions
M
 
B

Bob Phillips

=IF(B1="",0,IF(AND(A1=1,B1="Yes"),1,IF(AND(A1>1,B1="Yes"),2,"")))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
R

Ron Rosenfeld

I want to use two criterias for an answer?? If Column A contains a 1 and
Column B says Yes then return a 1 But if column B is blank return 0.. Then at
the same time if column A contains anything >1 and Column B says Yes return a
2 but if column B is blank return zero


Thanks For any suggestions
M

Using IF statements:

=IF(AND(A1=1,B1="Yes"),1,IF(AND(A1>1,B1="Yes"),2,0))

Different and perhaps more obscure:

=(A1>1)*(B1="Yes")*2+(A1=1)*(B1="Yes")


--ron
 

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