SOLVED

vlookup multiple values in one cell separated by comma

%3CLINGO-SUB%20id%3D%22lingo-sub-2028428%22%20slang%3D%22en-US%22%3Evlookup%20multiple%20values%20in%20one%20cell%20separated%20by%20comma%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2028428%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20cell%20that%20contains%20multiple%20data%20separated%20by%20a%20comma%20in%20sheet%20one%20(Picture%201)%3C%2FP%3E%3CP%3EThen%20I%20have%20a%20table%20that%20has%20data%20for%20each%20of%20that%20data%20in%20sheet%202%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20search%20the%20cell%20C2%20that%20has%20multiple%20data%20in%20it%20through%20the%20table%20in%20sheet%202%20and%20then%20write%20them%20the%20cell%20D2%20separated%20by%20comma%20again.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Pooyanekooei_0-1609743033173.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243766iC839A07B253F972D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Pooyanekooei_0-1609743033173.png%22%20alt%3D%22Pooyanekooei_0-1609743033173.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Pooyanekooei_1-1609743053348.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F243767i72A5785F3D4BD223%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Pooyanekooei_1-1609743053348.png%22%20alt%3D%22Pooyanekooei_1-1609743053348.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2028428%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2028493%22%20slang%3D%22en-US%22%3ERe%3A%20vlookup%20multiple%20values%20in%20one%20cell%20separated%20by%20comma%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2028493%22%20slang%3D%22en-US%22%3EOne%20way%20I%20believe%20you%20can%20do%20that%2C%20assuming%20you%20have%20the%20textjoin%20function%20(Ctrl%2BShift%2BEnter%20after%20keying%20into%20the%20formula%20bar)%3A%3CBR%20%2F%3E%3DTEXTJOIN(%22%2C%20%22%2CTRUE%2CIF(ISNUMBER(SEARCH('%D9%84%DB%8C%D8%B3%D8%AA%20%D9%81%DB%8C%D9%84%D8%AA%D8%B1%D9%87%D8%A7'!%24B%242%3A%24B%2419%2CC2))%2C'%D9%84%DB%8C%D8%B3%D8%AA%20%D9%81%DB%8C%D9%84%D8%AA%D8%B1%D9%87%D8%A7'!%24C%242%3A%24C%2419%2C%22%22))%3CBR%20%2F%3E%3CBR%20%2F%3EBut%2C%20I%20would%20think%20the%20new%20filter%20function%20would%20also%20work%2C%20if%20you%20have%20it.%20I%20personally%20don't%2C%20so%20this%20is%20not%20tested%2C%20but%20I%20would%20try%3A%3CBR%20%2F%3E%3DTEXTJOIN(%22%2C%20%22%2CTRUE%2CFILTER('%D9%84%DB%8C%D8%B3%D8%AA%20%D9%81%DB%8C%D9%84%D8%AA%D8%B1%D9%87%D8%A7'!%24C%242%3A%24C%2419%2CISNUMBER(SEARCH('%D9%84%DB%8C%D8%B3%D8%AA%20%D9%81%DB%8C%D9%84%D8%AA%D8%B1%D9%87%D8%A7'!%24B%242%3A%24B%2419%2CC2))))%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2029167%22%20slang%3D%22en-US%22%3ERe%3A%20vlookup%20multiple%20values%20in%20one%20cell%20separated%20by%20comma%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2029167%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F675152%22%20target%3D%22_blank%22%3E%40JMB17%3C%2FA%3E%26nbsp%3B%20Thank%20you%20so%20much%20it%20helps%20a%20lot%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20only%20problem%20is%20that%20I%20want%20to%20make%20the%20range%20from%202%20to%2050%20to%20have%20a%20space%20for%20future%20data%20adding.%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20this%20case%2C%20it%20showed%200%20for%20empty%20cells.%20can%20we%20do%20anything%20for%20this%20one%20as%20well%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20mean%20that%20in%20the%20formula%20I%20put%20the%20range%20from%20B2%3AB50%2C%20but%20actually%20I%20have%20data%20until%20B19%20and%20the%20rest%20are%20empty%20for%20now.%20(In%20the%20future%20I%20will%20more%20data)%20so%20the%20formula%20showed%200%20in%20the%20translate%20cell%20for%20each%20empty%20cell%20that%20is%20in%20the%20main%20cell.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20used%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3DTEXTJOIN(%22%2C%20%22%2CTRUE%2CIF(ISNUMBER(SEARCH('%D9%84%DB%8C%D8%B3%D8%AA%20%D9%81%DB%8C%D9%84%D8%AA%D8%B1%D9%87%D8%A7'!%24B%242%3A%24B%2450%2CC2))%2C'%D9%84%DB%8C%D8%B3%D8%AA%20%D9%81%DB%8C%D9%84%D8%AA%D8%B1%D9%87%D8%A7'!%24C%242%3A%24C%2450%2C%22%22))%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Eactualy%20I%20have%20data%20until%20B19.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2029517%22%20slang%3D%22en-US%22%3ERe%3A%20vlookup%20multiple%20values%20in%20one%20cell%20separated%20by%20comma%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2029517%22%20slang%3D%22en-US%22%3ETry%3A%3CBR%20%2F%3E%3DTEXTJOIN(%22%2C%20%22%2CTRUE%2C('%D9%84%DB%8C%D8%B3%D8%AA%20%D9%81%DB%8C%D9%84%D8%AA%D8%B1%D9%87%D8%A7'!%24B%242%3A%24B%2450%26lt%3B%26gt%3B%22%22)*IF(ISNUMBER(SEARCH('%D9%84%DB%8C%D8%B3%D8%AA%20%D9%81%DB%8C%D9%84%D8%AA%D8%B1%D9%87%D8%A7'!%24B%242%3A%24B%2450%2CC2))%2C'%D9%84%DB%8C%D8%B3%D8%AA%20%D9%81%DB%8C%D9%84%D8%AA%D8%B1%D9%87%D8%A7'!%24C%242%3A%24C%2450%2C%22%22))%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello 

I have a cell that contains multiple data separated by a comma in sheet one (Picture 1)

Then I have a table that has data for each of that data in sheet 2 

 

I want to search the cell C2 that has multiple data in it through the table in sheet 2 and then write them the cell D2 separated by comma again.

 

Pooyanekooei_0-1609743033173.png

Pooyanekooei_1-1609743053348.png

 

 

 

 

 

 

 

5 Replies
best response confirmed by Pooyanekooei (Occasional Contributor)
Solution

One way I believe you can do that, assuming you have the textjoin function (Ctrl+Shift+Enter after keying into the formula bar):
=TEXTJOIN(", ",TRUE,IF(ISNUMBER(SEARCH('لیست فیلترها'!$B$2:$B$19,C2)),'لیست فیلترها'!$C$2:$C$19,""))

But, I would think the new filter function would also work, if you have it. I personally don't, so this is not tested, but I would try:
=TEXTJOIN(", ",TRUE,FILTER('لیست فیلترها'!$C$2:$C$19,ISNUMBER(SEARCH('لیست فیلترها'!$B$2:$B$19,C2))))

 

There would be an issue in that you wouldn't get an error if there was an item in C2 that did not appear on the translation table (it would just get left out). So, you might consider adding a check column to confirm the number of items in the original and translated list are the same:

=LEN(C2)-LEN(SUBSTITUTE(C2,",",""))=LEN(D2)-LEN(SUBSTITUTE(D2,",",""))

 

@JMB17  Thank you so much it helps a lot

 

The only problem is that I want to make the range from 2 to 50 to have a space for future data adding. 

In this case, it showed 0 for empty cells. can we do anything for this one as well?

 

I mean that in the formula I put the range from B2:B50, but actually I have data until B19 and the rest are empty for now. (In the future I will more data) so the formula showed 0 in the translate cell for each empty cell that is in the main cell. 

 

I used 

=TEXTJOIN(", ",TRUE,IF(ISNUMBER(SEARCH('لیست فیلترها'!$B$2:$B$50,C2)),'لیست فیلترها'!$C$2:$C$50,""))

actualy I have data until B19. 

Try:
=TEXTJOIN(", ",TRUE,('لیست فیلترها'!$B$2:$B$50<>"")*IF(ISNUMBER(SEARCH('لیست فیلترها'!$B$2:$B$50,C2)),'لیست فیلترها'!$C$2:$C$50,""))
Thank you so much but this formula is not working at all
My apologies. I think I put the additional test for blank in the wrong place in the formula.

=TEXTJOIN(", ",TRUE,IF(('لیست فیلترها'!$B$2:$B$50<>"")*ISNUMBER(SEARCH('لیست فیلترها'!$B$2:$B$50,C2)),'لیست فیلترها'!$C$2:$C$50,""))