PDA

View Full Version : VLOOKUP to the left



rong3
10-02-2017, 12:57 AM
Hello, I am struggling with the VLOOKUP function, I have written code like this

Application.WorksheetFunction.VLookup(input_value, ThisWorkbook.Sheets(sheetname).Range(range_), Pos, 0)
Which input_value on Column B and want to get value of Column A. But it can not. Hope the help of you. Thanks so much.
20541

Mikey
10-02-2017, 03:58 AM
To achieve "left lookup" the standard way is using INDEX and MATCH, e.g. with a formula

=INDEX(A:A,MATCH(Z2,B:B,0))

That will look up Z2 in column B and return the corresponding value from Column A

Bob Phillips
10-02-2017, 04:46 AM
You can use VLOOKUP as well

=VLOOKUP(7125663,CHOOSE({1,2},$B$2:$B$3,$A$2:$A$3),2,FALSE)