VLOOKUP
takes the following arguments:
=VLOOKUP(lookup_value; table_array; col_index_num; [range_lookup])
lookup_value
is what will be looked for in the first column of table_array
.
table_array
is the table in which the lookup_value
and the value to be returned are.
col_index_num
is the number indicating the nth column within table_array
from which the value is to be returned from.
[range_lookup]
(defaults to true
) indicates the type of lookup, true being approximate and false being exact.
As such, if you want to find if A2
is in table $B$2:$B$11
, you need to use a col_index_num
of 1.
A simpler formula however would be with MATCH
:
=ISNUMBER(MATCH(A2; $B$2:$B$11; 0))
MATCH
returns the relative row number in which the value A2
is found. If there is a match, you get a number and hence ISNUMBER
returns TRUE
.
If you want to check if a value from column B exists in column A, then you have it reversed in the formula you used. Turning it around gives:
=ISNUMBER(MATCH(B2; $A$2:$A$11; 0))