View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Comparing two different columns - looking for similar data

Ok, try this...

Assume:

Long list in the range A2:A329
Short list in the range B2:B163

Create these named ranges...
Goto the menu InsertName Define
Name: Llist
Refers to: =$A$2:$A$329

Name: Slist
Refers to: =$B$2:$B$163

Enter this formula in cell D1. This will return the number of matches.

=SUMPRODUCT(--(ISNUMBER(MATCH(Slist,Llist,0))))

Enter this array formula** in D2:

=IF(ROWS(D$2:D2)<=D$1,INDEX(Slist,SMALL(IF(ISNUMBE R(MATCH(Slist,Llist,0)),ROW(Slist)),ROWS(D$2:D2))-MIN(ROW(Slist))+1),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Copy down until you get blanks meaning all matches have been extracted.

--
Biff
Microsoft Excel MVP


"Cheimbig" wrote in message
...
Yes - one column 328 and the other 162
--
Carla Heimbigner


"T. Valko" wrote:

Is one list longer than the other?

--
Biff
Microsoft Excel MVP


"Cheimbig" wrote in message
...
I have 2 columns with names
I want to have a 3rd column with only the names that match
Is there a function for doing this
--
Carla Heimbigner