I have look up table:
A | B |
---|---|
A | Apple |
B | Banana |
The I have column as
A |
---|
A |
A,B |
B |
I like the result to show as
A | B |
---|---|
A | Apple |
A,B | Apple, Banana |
B | Banana |
I have look up table:
A | B |
---|---|
A | Apple |
B | Banana |
The I have column as
A |
---|
A |
A,B |
B |
I like the result to show as
A | B |
---|---|
A | Apple |
A,B | Apple, Banana |
B | Banana |
To do this with a formula one must have TEXTJOIN which is available in Office365 and Excel 2019.
=TEXTJOIN(", ",TRUE,VLOOKUP(FILTERXML("<a><b>"&SUBSTITUTE(D1,",","</b><b>")&"</b></a>","//b"),A:B,2,FALSE))
If one does not have TEXTJOIN, vba or many helper columns will be necessary.
using vba one can create a TEXTJOIN look-a-like. See HERE for one.
We would also need to shift to an INDEX MATCH:
=TEXTJOIN(", ",TRUE,INDEX(B:B,N(IF({1},MATCH(FILTERXML("<a><b>"&SUBSTITUTE(D1,",","</b><b>")&"</b></a>","//b"),A:A,0)))))
And this would need to be confirmed using Ctrl-Shift-Enter instead of Enter when exiting edit mode.