Forum Discussion
Rfire777
Oct 01, 2022Copper Contributor
How to split the given text
Hi Everyone!
How can i split the text with two hyphen but need the result in only two parts, 1st is the two letter code and in second column need the rest of the text as shown in attached photo
3 Replies
- PeterBartholomew1Silver Contributor
- Harun24HRBronze Contributor
Rfire777 Excel for web and desktop O365-
=TEXTSPLIT(SUBSTITUTE(A1,"_","|",1),"|")For Excel 2013 and later-
=FILTERXML("<t><s>"&SUBSTITUTE(A1,"_","</s><s>",1)&"</s></t>","//s[1]") =FILTERXML("<t><s>"&SUBSTITUTE(A1,"_","</s><s>",1)&"</s></t>","//s[2]")Excel older than 2013-
=LEFT(A1,SEARCH("_",A1)-1) =MID(A1,SEARCH("_",A1)+1,100) - DexterG_IIIIron Contributor
=TEXTSPLIT(TEXTBEFORE(A2,"_")&"*"&TEXTAFTER(A2,"_"),"*")of course, replace the cell references with the cell containing the source text