Nested Functions

linaeum66

New Member
Joined
Jul 2, 2017
Messages
25
I am trying to make an equation that reformats international phone numbers.
For instance, if this is the input: +44(0)1111111111, I would like to make an equation to remove the "+", remove the "(0)" and add "011" as a prefix to the number.

For example +44(0)1111111111 would become 011441111111111

I have made the following formula to remove the "+", remove the "(0)"

=SUBSTITUTE(SUBSTITUTE(A1,"(0)", ""),"+","")

to yield: 441111111111

but how would I make a nested concatenation to add the "011" prefix in a single function?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi,

My understanding is that "prefix" within the brackets, in your sample (0) might sometimes be more than a single digit, so you might want to use something like this instead:



Book1
AB
1+44(0)1111111111011441111111111
2+44(044)1111111111011441111111111
3+441111111111011441111111111
Sheet83
Cell Formulas
RangeFormula
B1="011"&SUBSTITUTE(IFERROR(LEFT(A1,FIND("(",A1)-1)&MID(A1,FIND(")",A1)+1,15),A1),"+","")


Edit: updated formula to include possible numbers Without prefix in brackets.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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