Find Specific Text in a Cell

madab

New Member
Joined
Jan 29, 2014
Messages
27
Hi,


Any ideas how to get around this problem … I have 2 lists ofnames. One list is First Name and Last Name, the other list is Title First NameLast Name. I want to identify who is on both lists as best I can.


Any ideas how to do this in excel? I appreciate there maynot be a 100% accurate way of doing this due to multiple people having the samename e.g. John Smith etc. however any suggestions welcome to help me narrow thelist down would be appreciated.





Thanks
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
How you approach this depends on how the lists are arranged. Are the names in seperate cells? Same cells? Do they have carriage returns or any special characters? Is there potential for trailing spaces?
 
Upvote 0
Hi,

The names would be in one cell with a space between thefirst name and surname. There are no special characters and there shouldn’t beany trailing spaces other than the space between the first and surnames.

 
Upvote 0
Heres a couple that should get you going. The shorter name ie the one without the title is in A1 and the list to search in column B:

=MATCH("*"&A1&"*",B:B,0)
=COUNTIF(B:B,"*"&A1&"*")
 
Upvote 0
If you're interested in a VBA solution.
Code:
Sub finddupe()
   Dim cl As Range
   Dim x As String
   Dim Sp
   
   With CreateObject("scripting.dictionary")
      For Each cl In Range("G2", Range("G" & Rows.Count).End(xlUp))
         .Item(cl.Value) = Empty
      Next cl
      For Each cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
         If .exists(cl.Value) Then x = x & "|" & cl.Value
      Next cl
   End With
   Sp = Split(Replace(x, "|", "", 1, 1), "|")
   Range("K2").Resize(UBound(Sp) + 1).Value = Application.Transpose(Sp)
End Sub
This assumes your lists are in cols G & A, and will output in col K
 
Upvote 0

Forum statistics

Threads
1,216,212
Messages
6,129,547
Members
449,515
Latest member
lukaderanged

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