# Function using IF and AND

#### JMFW

##### Board Regular
Hi

I need to create a formula for the following:

If B6 = No and B7 = Yes and B22 =0
true statement Yes false statement No

I can't get it to work, can anyone help please.

Thanks in anticipation.

### Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
=IF(AND(B6="No",B7="Yes",B22=0),"Yes","No")

Try

=IF(B6="NO",IF(B7="YES",IF(B22=0,"YES", "NO"),"NO"),"NO")

HTH

Patrick

Thank you

I can now go home and relax over the weekend.
Thanks very much.

i have similiar issue however i need to use the if function with ranges.
Data in column C300-C347.

Column E is blank, I want to write a statement that if E matches those C300-347 then vlookup.
here is what i have so far but does nto work.

=IF(E286=C300:C347,VLOOKUP(E286,C300:C347,4,FALSE))
Can you please tell me if this is not the proper way to use it?

THanks

Well one way would simply be:

=IF(ISNA(VLOOKUP(E286,C300:C347,4,FALSE)),"",VLOOKUP(E286,C300:C347,4,FALSE))

If you have Excel 2007, there is the ISERROR function you can use. Ther first part can use MATCH instead if you like.

JMFWThanks!

Replies
5
Views
140
Replies
4
Views
472
Replies
2
Views
116
Replies
1
Views
238
Replies
15
Views
440

1,218,519
Messages
6,142,937
Members
450,456
Latest member
Exidur

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Which adblocker are you using?

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back