excel vba vlookup multiple values

Futurz

New member
Local time
Today, 22:04
Joined
Sep 17, 2021
Messages
26
Hi, I am looking for a simple vba for excel, to match a vlookup values mentioned in column 'E' and display the result in column 'F'
Given Index in Column 'B' and value in Column 'A'
Note : The attached file is a sample, but the actual data may be upto 100 rows...or more
 
There is no attachment. If memory serves, the index column must be to the left of the value column in a VLookup, though it's been a while.
 
Hi, Pbaldy,
I have reattached my xls file.
 

Attachments

This would appear to confirm my recollection that the index has to be to the left of the value, not the other way around:

 
Use index()and Match() instead.
 
This would appear to confirm my recollection that the index has to be to the left of the value, not the other way around:

Dear Pbaldy,
It doesn't matter if we shift "index" to the left of "value". I just need the result as mentioned.
Could you please set the above attached file to get the desired "result" (through a vba code)
Thanks.
 
Hopefully Gasman's suggestion works for you. I'm not that strong in Excel, I'd probably create a custom function or something.
 
Example 5 is your best bet.

However Vlookup only handles a single value in a cell, not a string of values, as you have in E5 ?
 
Dear Pbaldy,
It doesn't matter if we shift "index" to the left of "value". I just need the result as mentioned.
Could you please set the above attached file to get the desired "result" (through a vba code)
Thanks.

use vlookup.
 
Isaac, the problem is the multiple values in a cell. Do you know a way to make VLookup() handle that?
How is that meant to work anyway?, which value do you want to search for? :(
All of them?, so each subsequent one overwrites the value of the previous search?
 
I'm not the OP, but from the attachment each value in the lookup string gets its corresponding value returned in the return string. Concatenated lookup, concatenated result.
 
Dear Arnelgp,
I thank you once again for your brilliant efforts.
My query is Solved
Thanks...
Dear Arnelgp,
There is a little inaccuracy in the result when I modified the index & value data..
Please have a look at the attached file.
Thanks
 

Attachments

Isaac, the problem is the multiple values in a cell. Do you know a way to make VLookup() handle that?

Oh -
Sorry, I don't usually download people's Excel attachments, as I tend to help those who will describe the problem in writing.

Is it like multiple lines separated by line breaks? Some left, right, find, and char() might work? Increase complexity to find 2nd, 3rd, 4th lines etc.
Same thing if we're talking about the returned value, I guess you'd have to vlookup the whole thing, then start wrapping it in more formulas to chunk it out.

If I still have no idea what is needed, feel free to ignore me :p
 

Users who are viewing this thread

Back
Top Bottom