Forum Discussion
JelHew
Jan 03, 2023Copper Contributor
Need to find multiple search terms within my spreadsheet
Hello, I would like to write a code to find if any terms from my list (typed in column B) are found in column A. Column A Susan Prair Chalk Railroad Troublsom Waters Liszet...
- Jan 03, 2023
This may work for you. SEARCH is not used because of the potential for false positives (e.g. "USA" would be found in "Susan", etc.).
=IF(SUM(IFERROR(FIND(terms,A2),0))<>0,"A term is present","")
JelHew
Jan 04, 2023Copper Contributor
Patrick2788 Yes!! I am amazed you understood what I meant (even picked up on my Susan/USA issue! This is exactly what I need.
So let's say Column A is the content, Column B will say "term is present/blank", and column C I will put my list of words.
The code in cell B2 will be: =IF(SUM(IFERROR(FIND(C:C,A2),0))<>0,"A term is present","") ?? Thank you so much!
So let's say Column A is the content, Column B will say "term is present/blank", and column C I will put my list of words.
The code in cell B2 will be: =IF(SUM(IFERROR(FIND(C:C,A2),0))<>0,"A term is present","") ?? Thank you so much!
Patrick2788
Jan 04, 2023Silver Contributor
Glad it works for you. You are welcome!
- JelHewJan 15, 2023Copper ContributorPatrick2788
I think I might be a little off ..
So if Column A is the content
Column B will say "term is present/blank"
Column C I will put my list of words to search
Then the code in cell B2 will be: =IF(SUM(IFERROR(FIND(C:C,A2),0))<>0,"A term is present","")
Does this look correct??- Patrick2788Jan 15, 2023Silver ContributorIt might be a good idea to make the reference to Column C more specific. FIND isn't the fasted function by any means and checking 1 million+ cells is enough to slow calculations. Depending on what else is in the workbook, Excel might refuse to calculate it.