Return true if partial text is found

crunge75

New Member
Joined
Nov 15, 2017
Messages
5
I've tried so many examples and ideas from this site but to no avail! It seems simple enough and I'm probably just missing something but what I'm trying to do is this: If partial text is found return true, for example:

In A1
The quick brown fox jumps over the lazy dog.

In A2
The user can enter any part of the line above with additional verbiage for example:

The quick brown fox jumps over the lazy dog. However,

I can make it if any of the words in A! is typed in to return true, but if i type in words in A! with any additional information it returns false.

Any help would be appreciated!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi, welcome to the forum.

Is the additional verbiage always at the end? Or can it be at the start, in the middle etc? If not always at the end can you post a few more variations of the type of text you are comparing including some that should return a negative result? For each example state the desired result.
 
Upvote 0
If I understood you correctly, is this what you are looking for:

Code:
=ISNUMBER(SEARCH(A2,A1))
 
Upvote 0
Its actual preferable to be in any order so if the user adds any other words like:

The quick brown small fox jumps over the big lazy dog.

Here if the user enters these two words it will still return true.
 
Upvote 0
Number+Word1+Word2 FALSE Word2 Word3

Where the numbers 1,2,3 repents words, letter 2 in this case is the same.

The left side is what the user enters in. The right side is the criteria, where I need to return true because one of the words matches, in this case Letter2 For the left side it can again be preferable to be entered in any order.
 
Upvote 0
Hi, try to post several examples that cover all of the possible scenarios - for each example let us know what the expected result it.

If not always at the end can you post a few more variations of the type of text you are comparing including some that should return a negative result? For each example state the desired result.
 
Upvote 0
Here are some examples, currently using something like =ISNUMBER(SEARCH(E2,B2)), returns false. I need to make to be able to make these true.

User EntersResultCriteria
the quick brown, howeverFALSEThe quick brown fox jumps over the lazy dog.
fox jumps over and made itFALSEThe quick brown fox jumps over the lazy dog.
why did the lazy dog not see the foxFALSEThe quick brown fox jumps over the lazy dog.

<colgroup><col><col><col span="3"></colgroup><tbody>
</tbody>

<colgroup><col><col><col span="4"></colgroup><tbody>
</tbody>


I need to be able to make these return true because it found some of the words.
 
Upvote 0
I need to be able to make these return true because it found some of the words.

So, if any word from the criteria cell is in the user enters cell then return TRUE?

This isn't perfect (see the last example) but maybe it will work for you.


Excel 2013/2016
ABC
1User EntersResultCriteria
2the quick brown, howeverTRUEThe quick brown fox jumps over the lazy dog.
3fox jumps over and made itTRUEThe quick brown fox jumps over the lazy dog.
4why did the lazy dog not see the foxTRUEThe quick brown fox jumps over the lazy dog.
5dog brown greenFALSEblue red cat
6dog brown greenTRUEblue red cat brown
7however,TRUEhowever blue is good
8pineapples are tastyTRUEapple
Sheet1
Cell Formulas
RangeFormula
B2=ISNUMBER(LOOKUP(1,-SEARCH(TRIM(MID(SUBSTITUTE(C2," ",REPT(" ",99)),(ROW(INDEX(A:A,1):INDEX(A:A,LEN(C2)-LEN(SUBSTITUTE(C2," ",""))+1)))*99-98,99)),A2)))
 
Upvote 0
So, if any word from the criteria cell is in the user enters cell then return TRUE?

This isn't perfect (see the last example) but maybe it will work for you.

Excel 2013/2016
ABC
1User EntersResultCriteria
2the quick brown, howeverTRUEThe quick brown fox jumps over the lazy dog.
3fox jumps over and made itTRUEThe quick brown fox jumps over the lazy dog.
4why did the lazy dog not see the foxTRUEThe quick brown fox jumps over the lazy dog.
5dog brown greenFALSEblue red cat
6dog brown greenTRUEblue red cat brown
7however,TRUEhowever blue is good
8pineapples are tastyTRUEapple

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B2=ISNUMBER(LOOKUP(1,-SEARCH(TRIM(MID(SUBSTITUTE(C2," ",REPT(" ",99)),(ROW(INDEX(A:A,1):INDEX(A:A,LEN(C2)-LEN(SUBSTITUTE(C2," ",""))+1)))*99-98,99)),A2)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Hi there thanks so much for this -- this is exactly what I was looking for! Now I was curious is there any way for Row a:a,1 to read something like a2:a6? If I change it that way it makes all values to false. If I revert back it makes all values work correctly.
 
Upvote 0
Now I was curious is there any way for Row a:a,1 to read something like a2:a6?

Hi, you do not need to change that part of the formula, it's purpose is to robustly generate an array of numbers starting at 1 running up to the number of words in the criteria cell. The overhead from using full column references is small, especially when compared to alternative methods that achieve the same result.
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,580
Members
449,174
Latest member
chandan4057

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