Check If a Cell Includes List of Partial Values

L

Legacy 143009

Guest
Hello,

Usually, there are many methods to match the partial text in a range but I need just the opposite.
I have list of partial values and I want to check if a specific cell value includes any of those partial strings.

Thanks for the help!
 
Its simpler.
Code:
=OR(ISNUMBER(SEARCH($D$2:$D$4,A2)))
Book1
ABCD
1textpartial text
2I like dogTRUEdog
3I hate lionFALSEcat
4Catwalk in the nightFALSEelephant
Sheet1
Cell Formulas
RangeFormula
B2:B4B2=OR(ISNUMBER(SEARCH($D$2:$D$4,A2)))
B4 should return true since it includes one of the partial strings "cat".
 
Upvote 1

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Shortened it one final time! (Removed the last TRANSPOSE.)
a.xlsb
ABC
1abab39cfyes
2cdcfno
3efbefdyes
4ghghyes
5ab39cfyes
6cdyes
7dano
8catno
9reefyes
10aboutyes
11effortyes
12
Sheet9
Cell Formulas
RangeFormula
C1:C11C1=LET( substrFullCol,A:A, textFullCol,B:B, substrColRows,MAX(IF(substrFullCol<>"",ROW(substrFullCol),0)), textColRows,MAX(IF(textFullCol<>"",ROW(textFullCol),0)), substrCol,INDEX(substrFullCol,SEQUENCE(,substrColRows)), textCol,INDEX(textFullCol,SEQUENCE(textColRows)), IF(MMULT(IFERROR(FIND(substrCol,textCol),0),0*SEQUENCE(substrColRows)+1)>0,"yes","no") )
Dynamic array formulas.
Dear @cmowla thanks for your all effort but I am using 2019. So, the first suggestion has already worked perfectly for me.
 
Upvote 0
.@Flashbond
As has already been asked, please update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Another option might be ..

22 09 29.xlsm
ABC
1abab39cfTRUE
2cdcfFALSE
3ef
Check substrings
Cell Formulas
RangeFormula
C1:C2C1=COUNT(FIND(A$1:A$3,B1))>0
Thanks for the reminder. I was not around here for a long time. I was not aware of those options were available in account settings. I updated my account.
 
Upvote 0
Dear @cmowla thanks for your all effort but I am using 2019. So, the first suggestion has already worked perfectly for me.
That's perfectly okay. I actually made this, just in case you did. And it is very useful for those that do (and can be referenced in the future to solve similar problems in the future). So I thought it was worth the effort. (I never did this before, so it was a learning experience for me.)
 
Upvote 0
B4 should return true since it includes one of the partial strings "cat".
Dear @cmowla thanks for your all effort but I am using 2019. So, the first suggestion has already worked perfectly for me.
:confused: These two statements seem contradictory to me.

The first one seems to indicate that "Catwalk in the night" should return True because it contains "cat", yet the "first suggestion" mentioned in the second quote returns "no" (=false) for that same example (see col D below)

If the string check is not to be case-sensitive, wouldn't this do it?

Flashbond.xlsm
ABCD
1textpartial textpost #2
2I like dogTRUEdogyes
3I hate lionFALSEcatno
4Catwalk in the nightTRUEelephantno
Sheet2
Cell Formulas
RangeFormula
B2:B4B2=COUNT(SEARCH(C$2:C$4,A2))>0
D2:D4D2=IF(SUM(IFERROR(FIND($C$2:$C$4,A2),0))>0,"yes","no")
 
Upvote 0
Solution
:confused: These two statements seem contradictory to me.

The first one seems to indicate that "Catwalk in the night" should return True because it contains "cat", yet the "first suggestion" mentioned in the second quote returns "no" (=false) for that same example (see col D below)

If the string check is not to be case-sensitive, wouldn't this do it?

Flashbond.xlsm
ABCD
1textpartial textpost #2
2I like dogTRUEdogyes
3I hate lionFALSEcatno
4Catwalk in the nightTRUEelephantno
Sheet2
Cell Formulas
RangeFormula
B2:B4B2=COUNT(SEARCH(C$2:C$4,A2))>0
D2:D4D2=IF(SUM(IFERROR(FIND($C$2:$C$4,A2),0))>0,"yes","no")
Ok, my data were all in caps. The first suggestion had worked for me so I went with the first suggestion directly as soon as I saw "FALSE" next to "Cat". COUNT function is also lean. I will mark this as answer.
 
Upvote 0
Well if you ever upgrade to 365, you can convert my formula where you don't have to carry the formula down to case in-sensitive by simply changing FIND to SEARCH. (The same for the originally marked solution.) And COUNT can't be used in the non-carrydown version. (FYI)
 
Last edited:
Upvote 0
And COUNT can't be used in the non-carrydown version. (FYI)
Why not?

Flashbond.xlsm
ABC
1abab39cfTRUE
2cdcfFALSE
3efbefdTRUE
4ghghTRUE
5ab39cfTRUE
6cdTRUE
7daFALSE
8catFALSE
9reefTRUE
10aboutTRUE
11effortTRUE
Check substrings (2)
Cell Formulas
RangeFormula
C1:C11C1=LET(strings,B1:B11,substrings,A1:A4,BYROW(strings,LAMBDA(strings,COUNT(SEARCH(substrings,strings))>0)))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,652
Messages
6,126,033
Members
449,281
Latest member
redwine77

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