View Single Post
  #2   Report Post  
Adam Molinaro
 
Posts: n/a
Default

You have 2 lists, and you want to see if records of one list are contained in
another.

First List =
Animal Quantity
dog 3
rabbit 6
snake 5
eagle 5
pig 3
horse 5
hamster 7
hamster 7
gopher 6
goat 4

Second List =
SUBLIST VLOOKUP
RABBIT rabbit
snake snake
dragon #N/A

In your VLOOKUP column, type the formula =VLOOKUP(D3,$A$2:$B$11,1,FALSE),
assuming the first table was in columns A and B, and the second table is in
column D ('RABBIT' is in D3). With the formula, you are effectively saying,
"look at D3, then go to table $A$2:$B$11, look at the leftmost column, and
see if you find a match. If you do, return the value in the 1st column ('1'
in the formula)." The 'FALSE' indicates you want to find an exact match. If
this is omitted, or you put 'TRUE,' it will look for approximate matches,
which will [probably] be of no use whatsoever. In the example, you can see
'dragon' got an '#N/A' because it does not exist in the first table.
Furthermore, You can return other values besides the first column; if you
type in a '2' instead of a '1' in the formula, for the RABBIT record, you
would show '6.'

I hope that helps.

Adam.





"Garth" wrote:


--
gsimpson