IF statement that checks for data in two different cells

jmpatrick

Active Member
Joined
Aug 17, 2016
Messages
477
Office Version
  1. 365
Platform
  1. Windows
I've created a formula that checks for partial data matches in two different cells, but it's giving me a "too many arguments" error:

VBA Code:
=IF(OR(ISNUMBER(SEARCH({"*1072*","*1087*"},$C5))),"No BOM","BOM XL",IF(OR(ISNUMBER(SEARCH({"*"},$BP5))),"No BOM","BOM XL"))

I want to check for the presence of data containing 1072 or 1087 in $C5 and also check for an asterisk * in $BP5. So if either 1072 or 1087 appear in $C5 or an asterisk appears in $BP5 the result is "No BOM", otherwise it's "BOM XL".

Make sense?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
How about
=IF(OR(ISNUMBER(SEARCH({"*1072*","*1087*"},$C5)),ISNUMBER(SEARCH("*",$BP5))),"No BOM","BOM XL")
 
Upvote 0
How about
=IF(OR(ISNUMBER(SEARCH({"*1072*","*1087*"},$C5)),ISNUMBER(SEARCH("*",$BP5))),"No BOM","BOM XL")

Thanks for the quick response. You got closer than I did! No error message now, but it only works with 1072 and 1087. If there's an asterisk in $BP5 it doesn't respond.
 
Upvote 0
I have to correct my response. What I'm getting is "No BOM" when 1072 and 1087 is present in $C5, but only after I changed the formula to:

VBA Code:
=IF(OR(ISNUMBER(SEARCH({"*1072*","*1087*"},$C5)),ISNUMBER(SEARCH("*",$BP5))),"BOM XL","No BOM")

If there's an asterisk in $BP5 it doesn't respond.
 
Upvote 0
Do you want No BOM or BOM XL if c5 has 1072 or 1087?
 
Upvote 0
Ok, try
=IF(OR(ISNUMBER(SEARCH({"*1072*","*1087*"},$C5)),ISNUMBER(SEARCH("~*",$BP5))),"No BOM","BOM XL")
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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?

Disable AdBlock

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
Back
Top