function to search range and return a value from ajacent column

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

I need to "search" a column of data for a value. If it is
present, I need to return the value from the ajacent cell
in the next column.

For example: Column A has ID numbers and column B
contains the corresponding Name that goes with the ID
number. I need to run a "search" based on the value in an
unrelated cell where I will enter an ID number and have
the search value return the Name corresponding the the
ID. The ID number that I will enter to initiate the
search may or may not be in the list.

Since the ID may not be present, the search should say "IF
the given ID number is in column A then return the
corresponding value from column B, IF the ID number is not
in column A then return a zero or false value."
 
Hi Tim!

Say your table to search is in the range A5:B200 and the
value to search for is entered in cell A1:

=VLOOKUP(A1,A5:B200,2,0)

The 2 in the formula means the return value is in the 2nd
column.

If the value is not found, by default you'll get #N/A.

If you don't want #N/A, post back and we'll modify the
formula.

Biff
 
Back
Top