Converting telephone number

paulsolar

Well-known Member
Joined
Aug 21, 2013
Messages
684
Office Version
  1. 365
Hi All

I'm after a one line formula to do two jobs

We receive telephone number in this format 0123-4567891 and I'd like to convert them to this format 01234 567891.

I can use substitute the "-" with this =SUBSTITUTE(D2,"-","") in helper column 1 and and then get the format correct in helper column 2 (Y) using =TEXT(Y2,"##### ######")

I'd like to do it all with one formula if possible please and retain the leading zero as currently I am losing the leading zero in column Y

Any assistance would be greatly appreciated

cheers

Paul
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Is this what you want?
Excel Formula:
=REPLACE(SUBSTITUTE(D2,"-",""),6,0," ")
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Try
Excel Formula:
=REPLACE(SUBSTITUTE(D2,"-",""),6,0," ")

I won't mention Saturday. ;)
 
Last edited:
Upvote 0
You're welcome. Thanks for the follow-up. :)

Don't forget to update your version details though. ;)
 
Upvote 0
hat version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Try
Excel Formula:
=REPLACE(SUBSTITUTE(D2,"-",""),6,0," ")

I won't mention Saturday. ;)
I wouldnt either fluff
 
Upvote 0
Alternatively try:

Excel Formula:
=REPLACE(A1,5,2,MID(A1,6,1)&" ")
 
Upvote 0

Forum statistics

Threads
1,215,227
Messages
6,123,745
Members
449,116
Latest member
alexlomt

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