Vlookup value after comma+space and return each value seperated by comma+space till the last comma+space in the cell

sandeepsandeep

New Member
Joined
Dec 21, 2017
Messages
10
I have a query which I am unable to solve.

I have certain Values in Sheet1 in Col A as below
991121QR5, 991121XSX, 991234SSC, 991121SDF

In Sheet2 I have following Values in Col A and B
991121QR5 100100
991121SDF 121212
991234SSC 123456
991121XSX 888888

I want to vlookup each value after comma+space with the table in Sheet2 till the last comma+space in the series.

So when I enter the following in Col A
991121QR5, 991121XSX, 991234SSC, 991121SDF

Result should look like this in Col B
100100, 888888, 123456, 121212

Thanks in advance.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Would you be able to deconstruct the data on a separate tab using text to columns, do individual vlookups, and the concatenate the answers?
 
Upvote 0
If the sheet 2 info is split over two columns, wouldn't you be able to use a vlookup with a left/ mid/ right? Is the len for all codes in sheet1 the same?
 
Upvote 0
Sheet1 would look like following
ABC
CODESFINAL OUTPUTTOTAL
991121QR5, 991121XSX, 991234SSC, 991121SDF
991121QR5, 991121XSX, 991234SSC
991121QR5, 991121XSX, 991234SSC, 991121SDF

<colgroup><col width="297" style="width: 223pt;"><col width="97" style="width: 73pt;"><col width="46" style="width: 35pt;"></colgroup><tbody>
</tbody>

Sheet2 has following Table
AB
CODESValue
991121QR5 100100
991121SDF 121212
991234SSC 123456
991121XSX 888888

<colgroup><col width="87" style="width: 65pt;"><col width="55" style="width: 41pt;"></colgroup><tbody>
</tbody>

I want Final Output as foll
ABC
CODESFINAL OUTPUTTOTAL
991121QR5, 991121XSX, 991234SSC, 991121SDF100100, 888888, 123456, 1212121233656
991121QR5, 991121XSX, 991234SSC100100, 888888, 1234561112444
991121QR5, 991121XSX, 991234SSC, 991121SDF100100, 888888, 123456, 1212121233656

<colgroup><col width="297" style="width: 223pt;"><col width="200" style="width: 150pt;"><col width="64" style="width: 48pt;"></colgroup><tbody>
</tbody>

I want to vlookup each value after comma+space in sheet1 with the table in sheet2 and show the value as in the final output coloumn with comma+space. Also I want to add up all the values after comma+space in the Total coloumn. All this has to repeat till the last comma+space in the series.
 
Upvote 0
991121QR5, 991121XSX, 991234SSC, 991121SDF991121QR5991121XSX, 991234SSC, 991121SDF991121XSX991234SSC, 991121SDF991234SSC991121SDF991121SDF
991121QR5100100100100
991121XSX888888988988
991234SSC1234561112444
991121SDF1212121233656
991121SDF1212121354868
CODESValue
991121QR5100100
991121SDF121212
991121XSX888888
991234SSC123456
total
1354868
use helper columns to break the cell up and look up the segments in your code table
use a running total column and take the MAX value of that column…….
I will post the formulas if you are interested in this approach

<colgroup><col><col><col><col><col><col><col><col><col><col span="3"></colgroup><tbody>
</tbody>
 
Upvote 0
This is terrible design. Instead of figuring out a solution for this, I'd advise you to figure out a better way of doing this.
 
Upvote 0
This is terrible design. Instead of figuring out a solution for this, I'd advise you to figure out a better way of doing this.

Could you please help me out with the solution.

I have a query which I am unable to solve.


I have certain Codes in Sheet1 as below


ABC
1CODESOUTPUTSUM
2991121QR5, 991121XSX, 991234SSC, 991121SDF
2991121QR5, 991121XSX, 991234SSC
2991121QR5, 991121XSX, 991234SSC, 991121SDF

<tbody>
</tbody>


Table in Sheet 2 is as follows:-
AB
1CODESVALUE
2991121QR5100100
3991121XSX888888
3991234SSC123456
4991121SDF121212

<tbody>
</tbody>


The Final Outcome in Sheet 1 should be as follows:-
ABC
1CODESOUTPUTSUM
2991121QR5, 991121XSX, 991234SSC, 991121SDF100100, 888888, 123456, 1212121233656
2991121QR5, 991121XSX, 991234SSC100100, 888888, 1234561112444
2991121QR5, 991121XSX, 991234SSC, 991121SDF100100, 888888, 123456, 1212121233656

<tbody>
</tbody>



How can I get the above OUTCOME using one single formula to vlookup each value from cell A2 after comma+space from sheet1 with the table in sheet2 and place the output in same format as in cell a2 of sheet 1 in cell b2 of sheet 1. Also how to add up all the values of b2 in c2.
 
Upvote 0
Again, you need to stop putting things seperated by a comma in the same cell. That's bad design. Figure out a different way of doing this, then I will help you.
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,984
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top