Oct 06 2021 03:55 PM
Hi Everyone, thank you in advance for any help you are able to provide! I consider myself good at excel and power query but this is quite a beast in my opinion.
Device and OS platform: PC, Windows 10
Excel product name and version number: Excel 2102
As much context of what you're trying to do - and why:
Expected Result and Method:
Oct 06 2021 09:38 PM
SolutionAssuming you have Microsoft 365 (subscription version), you may use the following formulas for cells C3 to E3:
=TEXTJOIN(", ",TRUE,FILTER(J$3:J$6,ISNUMBER(SEARCH(J$3:J$6,B3)),""))
=TEXTJOIN(", ",TRUE,UNIQUE(FILTER(C$3:C$8,A$3:A$8=A3,"")))
=TEXTJOIN(", ",TRUE,UNIQUE(FILTER(VLOOKUP(C$3:C$8,J$3:K$6,2,FALSE),A$3:A$8=A3,"")))
Oct 07 2021 10:37 AM
@byundt Thank you! That worked almost perfectly. The only issue I'm having now is with the 3rd statement if there are blanks in the rows it returns N/A. Do you have any advice for that issue? Thanks again.
Oct 07 2021 11:08 AM
The suggested formulas return an empty string (looks like a blank) if the corresponding values in columns A or B are blank.
I can make the third formula return #N/A if your lookup table contains blank cells (not a good practice). If that's your problem, you can overcome it using:
=TEXTJOIN(", ",TRUE,UNIQUE(FILTER(IFNA(VLOOKUP(C$3:C$8,J$3:K$6,2,FALSE) & "",""),A$3:A$8=A3,"")))
Oct 07 2021 11:18 AM - edited Oct 07 2021 12:05 PM
The formula I you just added worked great, thank you! Out of curiosity why is having blanks not best practice? My lookup table does not have blanks but some of the rows might contain no key words and so the row would be blank. Do you have a recommended best practice instead?
Oct 07 2021 12:06 PM