text format

kennethr

New Member
Joined
Jun 8, 2006
Messages
13
I have a list of text (part numbers) such as 704A34101006 which I want to re format with dashes included i.e 704A34-1010-06, is there a simple way to do this for a large number of cells at once, they are all in the format without the dashes and I want to keep the same digits but in the fornat with dashes

Any help would be much appreciatted
:(
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Assuming text lengths are always the same you could use:
=LEFT(A1,6)&"-"&MID(A1,7,4)&"-"&RIGHT(A1,2)
where A1 houses 704A34101006.

Regards,
Jon :)
 
Upvote 0
Here is another one that only requires two function calls:
=REPLACE(REPLACE(A1,11,0,"-"),7,0,"-")
 
Upvote 0
if your text is in cell C1 then the following formula will give you the desired result

c1 = 704A34101006

=CONCATENATE(LEFT(C1,6), "-",MID(C1,7,4),"-",RIGHT(C1,2))

formula output = 704A34-1010-06

ravi
 
Upvote 0
if your text is in cell C1 then the following formula will give you the desired result

c1 = 704A34101006

=CONCATENATE(LEFT(C1,6), "-",MID(C1,7,4),"-",RIGHT(C1,2))

formula output = 704A34-1010-06

ravi
ravi

This suggestion certainly works but it is just the same as Jon's since CONCATENATE does just the same job as the '&' symbols in Jon's formula. This method still requires 4 functions whereas the REPLACE method only requires 2.
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,215
Members
448,874
Latest member
b1step2far

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