test a range of cells and return an adjacent value

W

whub3

I am trying to do a simple lookup in one range of cells that contain numbers
1-9 and return a result from the cell that is next to it.
 
B

Biff

Hi!

Assume your lookup value is in A1.

Your 2 column table is in the range A10:B18.

A1 = 7

=IF(A1="","",VLOOKUP(A1,A10:B18,2,0))

Biff
 
W

whub3

OK. That gave me the value I was searching for, but I want to return the an
adjacent value.
I have two columns, one with text and one with numerals. In a different cell
in the same worksheet I want to search the numerical column for a particular
number (like 1) and return the name (like Dave) that is adjacent (just to the
left) of the cell with the number from the number column.

Thanks!
 
K

Kevin Vaughn

If you need to return something to the left of your lookup range, then you
will need to use something like index/match instead of vlookup. Try this one:

=IF(A1 = "", "", INDEX($A$10:$A$18, MATCH(A1,$B$10:$B$18,0)))
 
W

whub3

Kevin,

Thank you. That answered my question

Kevin Vaughn said:
If you need to return something to the left of your lookup range, then you
will need to use something like index/match instead of vlookup. Try this one:

=IF(A1 = "", "", INDEX($A$10:$A$18, MATCH(A1,$B$10:$B$18,0)))
 
Top