Find if a text cell contains a string of characters from an array in a different workbook

kpieper876

New Member
Joined
Aug 12, 2011
Messages
13
I've scoured the internet for this answer and have not found a formula that works.

I have a list of domain names/URLs in column A of workbook 1:
jhjh.com
hajfh.co.nz
123.123.12.12

I have a list of domain name extensions in workbook #2:
.com
.co.nz
.net

I want to determine if the cells in column A workbook one contain any of the strings in workbook 2 - note that I need to look at the string, not the entire cell in workbook one. If there is a match, true, if not, false for that cell within workbook one.

It's sort of a reverse array lookup with text. It seems that cross workbook and text is what causes the challenge.

Thanks in advance.
 
Maybe this...

=IF(SUMPRODUCT(--ISNUMBER((SEARCH("*"&'[workbook02.xlsx]Sheet1'!$A$1:$A$3,A1)))),TRUE,FALSE)

Assumes Column A is being used for each list in its own workbook. Obviously change wrokbook02.xlsx to your actual workbook name. Oh, Sheet1 is assumed to have the list in workbook02.


Rick (or anyone), can you please explain to me how your combination works? I had a similar issue and yours worked for me as well. However, I get confused how the SUMPRODUCT formula helps. I now realize that this is the crucial part to the formula, but I do not understand how it is "sumproduct-ing" and what exactly it is "sumproduct-ing". It seems that what is inside the SUMPRODUCT() is either a zero or a one, so I am very confused. Thanks for your help!
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Rick (or anyone), can you please explain to me how your combination works? I had a similar issue and yours worked for me as well. However, I get confused how the SUMPRODUCT formula helps. I now realize that this is the crucial part to the formula, but I do not understand how it is "sumproduct-ing" and what exactly it is "sumproduct-ing". It seems that what is inside the SUMPRODUCT() is either a zero or a one, so I am very confused. Thanks for your help!

SEARCH creates 3 evaluations corresponding to the items from [workbook02.xlsx]Sheet1'!$A$1:$A$3 with respect to the string in A1: each evaluation is either a position value or a #VALUE! error. For example, something like:

{1;#VALUE!;#VALUE!}
{#VALUE!;1;#VALUE!}
{#VALUE!;#VALUE!;#VALUE!}

Applyinf ISNUMBER to the foregoing, we get...

{TRUE;FALSE;FALSE}
{FALSE;TRUE;FALSE}
{FALSE;FALSE;FALSE}

Applying -- to the ISNUMBER results, we get:

{1;0;0}
{0;1;0}
{0;0;0}

Applying SUMPRODUCT to the foregoing gives:

1
1
0

Applying IF to the foregoing, i.e.,

IF(1,TRUE,FALSE) --> TRUE
IF(1,TRUE,FALSE) --> TRUE
IF(0,TRUE,FALSE) --> FALSE

The same results can be obtained in a faster way also with:

=ISNUMBER(LOOKUP(9.99999999999999E+307,SEARCH([workbook02.xlsx]Sheet1!$A$2:$A$4,A2)))
 
Upvote 0
SEARCH creates 3 evaluations corresponding to the items from [workbook02.xlsx]Sheet1'!$A$1:$A$3 with respect to the string in A1: each evaluation is either a position value or a #VALUE! error. For example, something like:

{1;#VALUE!;#VALUE!}
{#VALUE!;1;#VALUE!}
{#VALUE!;#VALUE!;#VALUE!}

Applyinf ISNUMBER to the foregoing, we get...

{TRUE;FALSE;FALSE}
{FALSE;TRUE;FALSE}
{FALSE;FALSE;FALSE}

Applying -- to the ISNUMBER results, we get:

{1;0;0}
{0;1;0}
{0;0;0}

Applying SUMPRODUCT to the foregoing gives:

1
1
0

Applying IF to the foregoing, i.e.,

IF(1,TRUE,FALSE) --> TRUE
IF(1,TRUE,FALSE) --> TRUE
IF(0,TRUE,FALSE) --> FALSE

The same results can be obtained in a faster way also with:

=ISNUMBER(LOOKUP(9.99999999999999E+307,SEARCH([workbook02.xlsx]Sheet1!$A$2:$A$4,A2)))
Thanks for jumping in here and explaining the formula for me. I got a new computer (mostly up now) but before I could transfer all the data from my old computer, its water cooler pump broke and that part's failure prevented the old computer from starting up. I have now jury-rigged a solution to get the old computer running and am now in the process of transferring the data (it's going sloooowly) from one computer to the other; hence, now only has this kept me off-line, but I have lost touch with any threads I had participated in. I should be "back in business" full-time by next week I figure.
 
Upvote 0
Thanks for jumping in here and explaining the formula for me. I got a new computer (mostly up now) but before I could transfer all the data from my old computer, its water cooler pump broke and that part's failure prevented the old computer from starting up. I have now jury-rigged a solution to get the old computer running and am now in the process of transferring the data (it's going sloooowly) from one computer to the other; hence, now only has this kept me off-line, but I have lost touch with any threads I had participated in. I should be "back in business" full-time by next week I figure.

Yeah, it's always a tough experience. Sterkte (i.e., Dutch).
 
Upvote 0
Hello guys, i have similar problem, but dont know why your solutions does not worked, could u help me pls ?

sheet 3
column A
jhjh.com.mlm
hajfh.co.nz.ewr
123.123.12.12
mama.com
jhjh.com
evro.eu

<tbody>
</tbody>
sheet 4
column A
.com
.co.nz
.net
.eu

<tbody>
</tbody>

and my formula in sheet 3 column B is :
=IF(SUMPRODUCT(--ISNUMBER((SEARCH("*"&Sheet4!$A$1:$A$4&"*",A1)))),Sheet4!$A$1:$A$4,FALSE)

this is i have in result in Sheet 3 Column B
.com
.co.nz
FALSE
.eu
#VALUE!
#VALUE!

<tbody>
</tbody>

what i need actually:

in Sheet 1 Column a i will have a list of about 200 descriptions which i need check if there mentioned value from Sheet 2 Column A there can be about 2000 words...
And in Sheet 1 Column B i need put appropriate value from Sheet 2 Column A.


could u help me pls ?
 
Last edited:
Upvote 0
Hello guys, i have similar problem, but dont know why your solutions does not worked, could u help me pls ?

sheet 3
column A

sheet 4
column A


and my formula in sheet 3 column B is :
=IF(SUMPRODUCT(--ISNUMBER((SEARCH("*"&Sheet4!$A$1:$A$4&"*",A1)))),Sheet4!$A$1:$A$4,FALSE)

this is i have in result in Sheet 3 Column B

what i need actually:

in Sheet 1 Column a i will have a list of about 200 descriptions which i need check if there mentioned value from Sheet 2 Column A there can be about 2000 words...
And in Sheet 1 Column B i need put appropriate value from Sheet 2 Column A.


could u help me pls ?

Which sheets? The set of Sheet3 and Sheet4 or Sheet1 and Sheet2?

Sheet3, B2, just enter and copy down:

Either...
Rich (BB code):
=IFERROR(LOOKUP(9.99999999999999E+307,
   SEARCH(Sheet4!$A$2:$A$200,$B2),Sheet4!$A$2:$A$200),"")
Or...
Rich (BB code):
=LOOKUP(REPT("z",255),CHOOSE({1,2},"",
    LOOKUP(9.99999999999999E+307,SEARCH(Sheet4!$A$2:$A$200,$B2),
   Sheet4!$A$2:$A$200)))
 
Upvote 0
ok, so

sheet 1 column A:
Igor wanna eat
I know Charlie wanna Eat
Max killed Johnny
Johnny and Max are friends
U know Charlie and Joe drunk a lot of alcohol yesterday

<colgroup><col></colgroup><tbody>
</tbody>

Sheet 2 column A:
Igor
Charlie
Johnny
Max
Ive
Marie
Const

<colgroup><col></colgroup><tbody>
</tbody>

And i wanna see in Sheet 1:
Igor wanna eatIgor
I know Charlie wanna EatCharlie
Max killed JohnnyJohnny
Bob and Max are friendsBob
U know Charlie and Joe drunk a lot of alcohol yesterdayCharlie

<colgroup><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,254
Messages
6,123,894
Members
449,132
Latest member
Rosie14

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