Match set of strings to list of strings in one column and return unique values

lady_alina

Board Regular
Joined
Feb 18, 2015
Messages
52
Hi,

Thanks in advance. This site has always been so helpful and I expect to get an answer for this problem as well.

I have given below table to show you example, what I want is set of strings in column B (sheet 1) should match its words with sheet 2 column a and sheet 3 column a if any word is found in sheet 2 column a which is also found in sheet 3 column a then that word should be excluded from the out put like for examples you can check the first column of sheet 1 column C - ideally it should have copied alina, tim but since alina is found in sheet 3 column a it is excluded from the output and only tim is copied. Hop eI made myself clear. Please help me with a vba code to simplify my work.


Sheet 1
Column AColumn BColumn C
1ABC THY Alina tim tomorrowtim
2WERT 00 PETER TIMPeter
3GYT GEORGE ALINA GNEHGeorge, Alina
4PWO0 MIKE KLERWMike

<tbody>
</tbody>


Sheet2
Alina
Peter
George
Alina
Mike

<tbody>
</tbody>


Sheet3
Column A
theg
uhwt
teh alina wer

<tbody>
</tbody>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
if your string is "abc tim def" and sheet 2 is "abc def tim" and sheet 3 is " abcd time cdef"

how do we identify that tim is a name and abc is not?
 
Upvote 0
Forgive me if I am not able to make myself clear. Here it is again what I want

Its the words that we are searching for in sheet 2 column A. - example cell 2 - Tim, cell 3 - Peter, cell 3 - Alina. We are searching this words in sheet 1 column B - Example cell 2 - The tim poe peter, cell 3 theg alina ger00, cell 4 - kle alina peter thew and sheet 3 which has similar kind of column like column b in sheet 1. If any of the words from column A sheet 3 is found in sheet 2 column A then it should be excluded from the output result and which ever word from sheet 2 column A is found in cell 2 in sheet 1 column B then it should be copied, however the result/output should be unique and if found more than one result then it should be like this peter, alina (comma separated results)
 
Last edited:
Upvote 0
I CAN search for tim and alina, and reject alina because it is founf in sheet 2 and in sheet 3

BUT

how do I know in the first place I am searching for tim, why is tim different from abc, do you have a list of names somewhere?
 
Upvote 0
@lady_alina

1) Is it true that you have duplicates in Sheet2 like Alina?

2) What is the result in C1 of Sheet1 is Tim, that is, how does that obtain?

3) Why no Tim in C2 of Sheet2 along with Peter?

4) How does the list of Sheet3 relate to other sheets?
 
Upvote 0
alinatimpetergeorgemike
1ABC THY Alina tim tomorrow1
2WERT 00 PETER TIM1
3GYT GEORGE ALINA GNEH
4PWO0 MIKE KLERW
Alina
Peter
George
Alina
Mike
theg
uhwt
the
alina
wer
is mike excluded as he is in verification list?

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,216,171
Messages
6,129,281
Members
449,498
Latest member
Lee_ray

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