If one of multiple wildcards appears in 5 different cells, then display value in adjacent cell

CF64

New Member
Joined
Feb 17, 2021
Messages
48
Office Version
  1. 365
Platform
  1. Windows
Hello and Happy New Year,
I am trying to find a way to look across a range of 6 cells in the same row, to find any of multiple wildcard values and, in an adjacent cell, return a "yes" if any one of the multiple wildcards is found in any of the cells in the range, or "no" if not.

Initially, I was able to use the following formula in column E, when I was just looking in 4 cells...
=IF(SUM(COUNTIF(a2,{"*hockey*","*field*","*baseball*"})+COUNTIF(b2,{"*hockey*","*field*","*baseball*"})+COUNTIF(c2,{"*hockey*","*field*","*baseball*"})+COUNTIF(d2,{"*hockey*","*field*","*baseball*"})),"YES","NO")

...but when I added the 2 additional cells to check (F2 and G2), I received the "you've entered too many arguments"

Also, in the 2 additional cells I would be looking for different wildcard values than the preceding 4 cells.

Any advice is very much appreciated
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
what wild cards are you looking for
Why not use the range
=COUNTIF(A2:D2,"*hockey*")+COUNTIF(A2:D2,"*field*")+COUNTIF(A2:D2, "*baseball*")
Then you can add the other criteria for F2 & G2
rather than an array

=IF(COUNTIF(A2:D2,"*hockey*")+COUNTIF(A2:D2,"*field*")+COUNTIF(A2:D2, "*baseball*")+COUNTIF(F2:G2,"*Tennis*")+COUNTIF(F2:G2, "*football*"),"YES","NO")

Book1
ABCDEFGH
1
2football
3
4
5A-DNO+F-GYES
6Count0
7
Sheet2
Cell Formulas
RangeFormula
H5H5=IF(COUNTIF(A2:D2,"*hockey*")+COUNTIF(A2:D2,"*field*")+COUNTIF(A2:D2, "*baseball*")+COUNTIF(F2:G2,"*Tennis*")+COUNTIF(F2:G2, "*football*"),"YES","NO")
E5E5=IF(COUNTIF(A2:D2,"*hockey*")+COUNTIF(A2:D2,"*field*")+COUNTIF(A2:D2, "*baseball*"),"YES","NO")
E6E6=COUNTIF(A2:D2,"*hockey*")+COUNTIF(A2:D2,"*field*")+COUNTIF(A2:D2, "*baseball*")
 
Upvote 0
Another option
Excel Formula:
=IF(SUM(COUNTIF(A2:D2,{"*hockey*","*field*","*baseball*"}))+SUM(COUNTIF(F2:G2,{"*Rugby*","*curling*"})),"YES","NO")
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,231
Members
448,951
Latest member
jennlynn

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