# text format

#### kennethr

##### New Member
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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

#### Jon von der Heyden

##### MrExcel MVP, Moderator
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

#### Peter_SSs

##### MrExcel MVP, Moderator
Here is another one that only requires two function calls:
=REPLACE(REPLACE(A1,11,0,"-"),7,0,"-")

#### ravishankar

##### Well-known Member
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

#### Peter_SSs

##### MrExcel MVP, Moderator
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.

Replies
3
Views
369
Replies
7
Views
375
Replies
2
Views
166
Replies
3
Views
254
Replies
16
Views
376

1,136,369
Messages
5,675,362
Members
419,565
Latest member
Phil57

### 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?

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