PDA

View Full Version : Vlookup reverse



baggins22
03-10-2007, 03:01 PM
Hey everybody,

so im new to this forum, and new to VBA. This isnt really a VBA question, but has to do with excel non the less.

normally vlookup gets its value from the left most column of the table array by default. i need it to get the value from the right most column..

Example:

A ---------- B --------- C
1215 ----Type1------ Name
1353-----Type2------ Name2


From a different tab , i need vlookup to search for a name in column C and retrieve the value in column A

Any ideas?

mdmackillop
03-10-2007, 03:33 PM
Hi Baggins
Welome to VBAX
Assuming your search term is in E1

=INDIRECT(ADDRESS(MATCH(E1,C$1:C$17,0),1))

from another sheet

=INDIRECT("Sheet1!" & ADDRESS(MATCH(E1,Sheet1!C$1:C$17,0),1))

gnod
03-10-2007, 08:46 PM
Hi,

pls refer to the attach file..

Bob Phillips
03-10-2007, 10:11 PM
=INDEX(Sheet2!A:A,MATCH(A1,Sheet2!C:C,0))

baggins22
03-11-2007, 01:30 PM
Thanks for all the help!

baggins22
03-11-2007, 04:50 PM
Could somebody give me a little explanation how the formula is done. im having some trouble converting it to my file.

Thanks

mdmackillop
03-11-2007, 05:18 PM
The formula is set up to look up the value in A1 where names are in Sheet 2 Column C and numbers in Sheet 2 column A.

If your data and lookup value is all in one sheet use
=INDEX(A:A,MATCH(E1,C:C,0)), where the lookup value is in E1, Names in Column C and Numbers in Column A