Search a column for cell contents, in any order

cash2021

New Member
Joined
Dec 5, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi! I have a basic formula that searches a column for a cell's contents - in the attached example, I'm checking if the text in B2 ('affordable plumbers') appears in any of the cells in column A. I'd like to evolve this formula (or replace it entirely) with a formula that can check if the contents of cell B2 appear *in any order* in any cell in Column A. In this example, I'd want to also yield a 'yes' next to the targeted keyword 'plumbers that are affordable', because it contains both 'plumbers' & 'affordable'. Formula I'm using is below! TIA! :)

Code:
=IF(COUNTIF($A$2:$A$1048576,"*"&B2&"*"),"Yes","No")
 

Attachments

  • yes.PNG
    yes.PNG
    9.1 KB · Views: 8
  • no.PNG
    no.PNG
    9 KB · Views: 8

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
It can be more than 2 words! Honestly though, it likely wouldn't be impactful past 4 words (low volume).
 
Upvote 0
Try:

Excel Formula:
=IF(ISNUMBER(SEARCH("1",TEXTJOIN("",,LET(a,B2,BYROW(ISNUMBER(SEARCH(TEXTSPLIT(a," "),$A$2:$A$100))*1,LAMBDA(br,IF(SUM(br)=LEN(a)-LEN(SUBSTITUTE(a," ",""))+1,1,0))))))),"Yes","No")
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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