Table Transform add zero

mduntley

Board Regular
Joined
May 23, 2015
Messages
139
Office Version
  1. 365
Platform
  1. Windows
So I found a way yesterday to use table.Transform to add a leading zero if its not 4 digits, but I forgot how I did it

Power Query:
= #table({"Column 1"}, {{"740"},{"250"},{"0943"},{"420"},{"430"},{"440"},{"424"},{"0434"}})
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Power Query:
let
    Source = #table({"Column 1"}, {{""},{"0"},{"1"},{"21"},{"420"},{"430"},{"440"},{"1424"},{"0434"}}),
    tbl = Table.TransformColumns(Source, {"Column 1", each Text.PadStart(_,4, "0")})
in
    tbl
 
Upvote 0
Solution

Forum statistics

Threads
1,226,695
Messages
6,192,475
Members
453,726
Latest member
JoeH57

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