# Nesting IF AND OR Functions

#### bstrange

##### New Member
Not sure where to go from here.

I am trying to write a formula that checks the following.
If A2=A3 is true AND B2=B3 is true OR if C2 contains the string "packet" then return "" in D2. If false then D2 = 10.

Another way to say it. If 2 consecutive order ID# are = AND 2 consecutive ship dates are =, OR description contains "packet" then Order charge = "". If not, then order charge = 10.

This is what I tried for D2, but didn't work.
=IF((A2=A3),IF((B2=B3),IF(SEARCH("PACKET",C2,1),"",10),10))

Thanks for any help. This one has got me stumped.<SCRIPT language=JavaScript src="http://www.interq.or.jp/sun/puremis...[/XD][XH][/XH][/XR][/RANGE][/XH][/XR][/RANGE]

Last edited:

### Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try this:

=IF(OR(NOT(ISERROR(SEARCH("packet",C2))),AND(A2=A3,B2=B3)),"",10)

Thanks jbeaucaire!! That seems to work prefectly so far.

Not sure why you're using search since you have no other text besides packet when it appears according to your sample, but you should not need NOT(ISERROR. ISNUMBER would accomplish the same thing.

=IF(OR(C2="packet",AND(A2=A3,B2=B3)),"",10)

If you actually need to search:

=IF(OR(ISNUMBER(SEARCH("packet",C2)),AND(A2=A3,B2=B3)),"",10)

Replies
6
Views
415
Replies
0
Views
171
Replies
6
Views
240
Replies
9
Views
161
Replies
4
Views
145

1,196,280
Messages
6,014,433
Members
441,818
Latest member
itsfaisalkhalid

### 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.

### Which adblocker are you using?

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

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