Converting telephone number

paulsolar

Well-known Member
Joined
Aug 21, 2013
Messages
696
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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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