• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to split text

Hi,

I have one doubt regarding how to split text.
I have a text like 1232_ABC_Chea Kana and I want to split it by underscore ( _ ) . First I am thinking about find function, but it could not help since there are so many underscore.
please find attached file for more detail.
Thanks,
 

Attachments

  • split text.xlsx
    8.4 KB · Views: 10
Thanks it work perfectly. However, in the formula, I have changed from 50 to len ($A2) to avoid any mistake.
Thanks again for help.
 
The quickest and easiest way is to use Power Query/Get and Transform. Here is the Mcode and the file for review.

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "Source", Splitter.SplitTextByDelimiter("_", QuoteStyle.Csv), {"Source.1", "Source.2", "Source.3", "Source.4"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Source.1", Int64.Type}, {"Source.2", type text}, {"Source.3", type text}, {"Source.4", type text}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Source.1", "Code"}, {"Source.2", "Name"}, {"Source.3", "Province"}, {"Source.4", "Branch"}})
in
    #"Renamed Columns"
 

Attachments

  • split text.xlsx
    17.9 KB · Views: 1
Hi,​
as it no needs any code neither any formula just using the Excel Basics feature Text To Columns ! The easiest & quickest way …​
 
Back
Top