if,and or functions

G

Guest

Could someone please help

I like to write a formula

If Cell A =1, and Cell B= 2,3,4,5,or 6, then give me a result of 1,
otherwise 0

Thanks
 
N

Niek Otten

=IF(AND(A1=1,OR(B1={2,3,4,5,6})),1,0)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Could someone please help
|
| I like to write a formula
|
| If Cell A =1, and Cell B= 2,3,4,5,or 6, then give me a result of 1,
| otherwise 0
|
| Thanks
 
G

Guest

Assuming your A=1 value is in cell A1 and your Cell B value is in B1, this
formula should work:

=IF(B1=1,IF(B2=2,1,IF(B2=3,1,IF(B2=4,1,IF(B2=5,1,IF(B2=6,1,0))))),0)
 

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