I IeuanCilgwri New Member Jan 26, 2023 #1 The above is an extract of a very large value in a single cell, I would to extract into a cell ALL the instances that occur between the "-" - so the above would return LFN,LFN,LEM,LEL - thank you!
The above is an extract of a very large value in a single cell, I would to extract into a cell ALL the instances that occur between the "-" - so the above would return LFN,LFN,LEM,LEL - thank you!
P Peter Bartholomew Well-Known Member Jan 26, 2023 #2 With 365 you could try things like Code: = LET( splitOnHyphen, TEXTSPLIT(value,,"-"), twoColumns, WRAPROWS(splitOnHyphen,2), codeInstances, TAKE(twoColumns,, 1), TEXTJOIN(",",,codeInstances) ) which picks up on the alternating pattern of hyphens. There are some add-ins that implement RegEx, one of which is Charles Williams's FastExcel (c) Code: = Rgx.MID(value,"\-\w{3}\-",0)
With 365 you could try things like Code: = LET( splitOnHyphen, TEXTSPLIT(value,,"-"), twoColumns, WRAPROWS(splitOnHyphen,2), codeInstances, TAKE(twoColumns,, 1), TEXTJOIN(",",,codeInstances) ) which picks up on the alternating pattern of hyphens. There are some add-ins that implement RegEx, one of which is Charles Williams's FastExcel (c) Code: = Rgx.MID(value,"\-\w{3}\-",0)
B bosco_yip Excel Ninja Jan 27, 2023 #3 Try, In B, enter formula: =TEXTJOIN(",",,FILTERXML("<a><b>"&SUBSTITUTE("@"&A2,"-","</b><b>")&"</b></a>","//b[string-length(.)=3]"))
Try, In B, enter formula: =TEXTJOIN(",",,FILTERXML("<a><b>"&SUBSTITUTE("@"&A2,"-","</b><b>")&"</b></a>","//b[string-length(.)=3]"))