Split in Power Query

srehman

Board Regular
Joined
Jan 4, 2020
Messages
210
Office Version
  1. 2016
Platform
  1. Windows
AS123456 Split only starting Alphabet (AS) & (123456) or separate number & alphabet in 2 columns

AMRP2541 Split only starting Alphabet (AMRP) & (123456) or separate number & alphabet in 2 columns
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Text = Table.AddColumn(Source, "Text", each Text.Select([Raw],{"A".."Z"})),
    Number = Table.AddColumn(Text, "Number", each Text.Select([Raw],{"0".."9"})),
    TSC = Table.SelectColumns(Number,{"Text", "Number"})
in
    TSC
RawTextNumber
AS123456AS123456
AMRP2541AMRP2541
 
Upvote 0
Here is an alternative PQ solution

Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Character Transition" = Table.SplitColumn(Source, "Raw", Splitter.SplitTextByCharacterTransition((c) => not List.Contains({"0".."9"}, c), {"0".."9"}), {"Text", "Number"})
in
    #"Split Column by Character Transition"
 
Upvote 0

Forum statistics

Threads
1,223,790
Messages
6,174,600
Members
452,574
Latest member
hang_and_bang

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top