Monday, September 11, 2017

Split a column of text (Power Query)

Split a column of text (Power Query)

Note: Power Query is known as Get & Transform in Excel 2016. Information provided here applies to both. To learn more, see Get & Transform in Excel 2016.

Note: For a quick video on how to display Query Editor, see the end of this article.

Using the Query Editor, a column of text can be split into multiple columns in two ways: by delimiter or by a number of characters.

I want to

Split a column by delimiter

Split a column by position

Split a column by delimiter

Split Column > By Delimiter parses a text value based on a common character into two or more columns. For example, a Name column as LastName, FirstName can be split into two columns based on the comma (,) character.

Using the Query Editor ribbon

  1. Select the column you want to split.

  2. In the Query Editor ribbon, select Split Column > By Delimiter.

Using the Query Editor context menu

  1. Right-click the column header you want to split.

  2. In the column context menu, select Split Column > By Delimiter.


To split a column by delimiter

  1. In the Split a column by delimiter dialog box:

    1. In the Select or enter a delimiter drop-down, select Colon, Comma, Equals Sign, Semicolon, Space, Tab, or Custom. Select Custom to specify any character delimiter.

    2. Select a Split option.

    3. Expand Show advanced options, and enter the Number of columns to split into.

  2. Select OK.

  3. Rename the new columns to more meaningful names. For more information about how to rename a column, see Rename a column.

  1. In the Split a column by delimiter dialog box:

    1. In the Select or enter a delimiter drop-down, select Colon, Comma, Equals Sign, Semicolon, Space, Tab, or Custom. Select Custom to specify any character delimiter.

    2. Select a Split option.

    3. Expand Show advanced options, and enter the Number of columns to split into.

  2. Select OK.

  3. Rename the new columns to more meaningful names. For more information about how to rename a column, see Rename a column.

Top of Page

Split a column by position

Split Column > By Number of Characters parses a text value based on a character position within a text value.

Using the Query Editor ribbon menu

  1. Select the column you want to split.

  2. In the Query Editor ribbon, click Split Column > By Number of Characters.

Using the Query Editor context menu

  1. Right-click the column header you want to split.

  2. In the column context menu, select Split Column > By Number of Characters


To split a column by position

  1. In the Split a column by position dialog box:

    1. In the Number of character textbox, enter the number of characters used to split the text column.

    2. Select a Split option.

    3. Expand Show advanced options, and enter the Number of columns to split into.

  2. Click OK.

  3. Rename the new columns to more meaningful names. For more information about how to rename a column, see Rename a column.

  1. In the Split a column by position dialog box:

    1. In the Number of character textbox, enter the number of characters used to split the text column.

    2. Select a Split option.

    3. Expand Show advanced options, and enter the Number of columns to split into.

  2. Click OK.

  3. Rename the new columns to more meaningful names. For more information about how to rename a column, see Rename a column.

Top of Page

Note: The Query Editor only appears when you load, edit, or create a new query using Power Query. The following video shows the Query Editor window appearing after editing a query from an Excel workbook. To view the Query Editor without loading or editing an existing workbook query, from the Get External Data section in the Power Query ribbon tab, select From Other Sources > Blank Query. The following video shows one way to display the Query Editor.

How to see Query Editor in Excel

No comments:

Post a Comment