Comparing Text from Two Columns Against a Single Cell

redsunrising15

New Member
Joined
Jan 5, 2018
Messages
4
Hello all,

I am working with two columns of information, and one additional cell of data.

One column is words and multi-word objects and the other is the acronyms that represent those words.

In the single cell of data is a long list of both words, phrases, and acronyms. My goal is to check the single cell against both columns to make sure that the single cell does not contain both an acronym and what it stands for.

I am trying to search the columns at the same time (the words and acronyms are A2:16, B2:16 respectively, and they correspond to each other.) If the single cell contains both a string from the first column and the second column, I want it to send me an indicator and then tell me which items caused the error.

Currently I am using =IF(ISNUMBER(SEARCH(A2:16, C19)),ISNUMBER(SEARCH(B2:16,C19))) with C19 being the single cell. The function only seems to work on select words, no phrases, and only for the very first pair (A2, B2).

Any help would be appreciated. :)
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try...

=IF(ISNUMBER(SEARCH(" "&VLOOKUP(LOOKUP(9.99999999999999E+307,SEARCH(" "&B2:B16&" "," "&C19&" "),B2:B16),CHOOSE({1,2},B2:B16,A2:A16),2,0)&" "," "&C19&" ")),"word and acronym present at the same time","not both word and acronym")
 
Upvote 0
It doesn't seem to be working. It outputs "not both word and acronym" no matter what.

Row\Col
A​
B​
C​
1​
word and acronym present at the same time
2​
connecticutCT
3​
californiaCA
4​
new yorkNY
5​
6​
7​
8​
9​
10​
11​
12​
13​
14​
15​
16​
17​
18​
19​
NY New York

C1 >>

=IF(ISNUMBER(SEARCH(" "&VLOOKUP(LOOKUP(9.99999999999999E+307,SEARCH(" "&B2:B16&" "," "&C19&" "),B2:B16),CHOOSE({1,2},B2:B16,A2:A16),2,0)&" "," "&C19&" ")),"word and acronym present at the same time","not both word and acronym")
 
Upvote 0
It is working for me now, thanks!

Is there a way to detect which pair caused the error? My list of words and acronyms is several thousand columns long and would be a complete pain to hunt down by hand.
 
Upvote 0
It is working for me now, thanks!

Is there a way to detect which pair caused the error? My list of words and acronyms is several thousand columns long and would be a complete pain to hunt down by hand.

Row\Col
A​
B​
C​
1​
Word and Acronym Error: New York | NY
2​
ConnecticutCT
3​
CaliforniaCA
4​
New YorkNY
5​
6​
7​
8​
9​
10​
11​
12​
13​
14​
15​
16​
17​
18​
19​
NY New York

In C1 enter:

=IF(ISNUMBER(SEARCH(" "&VLOOKUP(LOOKUP(9.99999999999999E+307,SEARCH(" "&B2:B16&" "," "&C19&" "),B2:B16),CHOOSE({1,2},B2:B16,A2:A16),2,0)&" "," "&C19&" ")),"Word and Acronym Error: "&VLOOKUP(LOOKUP(9.99999999999999E+307,SEARCH(" "&B2:B16&" "," "&C19&" "),B2:B16),CHOOSE({1,2},B2:B16,A2:A16),2,0)&" | "&LOOKUP(9.99999999999999E+307,SEARCH(" "&B2:B16&" "," "&C19&" "),B2:B16),"OK")
 
Upvote 0

Forum statistics

Threads
1,215,457
Messages
6,124,941
Members
449,197
Latest member
k_bs

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