Reformatting All Numbers in a Column

pclutts

New Member
Joined
Dec 6, 2005
Messages
3
I need to change all numbers in a column from 012345678 to 0123-45-678. Can anyone tell me how to do that globally instead of changing them one at a time? Thanks in advance for the help.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

jdc

Active Member
Joined
Nov 23, 2004
Messages
263
Hi,
Just select the column and Format, pick Custom and type 0000-00-000 in the box.

HTH

John
 

SteveO59L

Well-known Member
Joined
Apr 21, 2004
Messages
7,899
Either use jdc's suggestion, or something along the lines of

=left(a1,4)&"-"&mid(a1,5,2)&"-"&right(a1,3)
 

pclutts

New Member
Joined
Dec 6, 2005
Messages
3
I used jdc's suggestion and it worked. However, leading zeros where removed, and I need to keep them. Also, I have to double-click on every individual cell to get the reformatting to take affect. I wanted to be able to make this change globally. Any other help is appreciated. Thanks.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,806
Messages
5,833,778
Members
430,232
Latest member
Testsubject

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
Top