MS Excel: Nesting SUBSTITUTE & CONCATENATE Formula within Text String

Miaka3

New Member
Joined
Oct 10, 2015
Messages
2
I would like to know if it's possible to combine a nested SUBSTITUTE and CONCATENATE formula or similar to add/insert a Character within text string


I have a column containing keywords (Cell: A2:A3) that I would like to place a unique character ("$") within the text string in front of each of the keyword discovered within the text.


Keywords:
A2: New York, NY
A3: (250) 888-0000


OLD TEXT (Cell: B2)
John X. Doe New York, NY (250) 888-0000 johndoe@myemail.com


OUTPUT TEXT (Cell: C2)
John X. Doe $New York, NY $(250) 888-0000 johndoe@myemail.com
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Code:
=SUBSTITUTE(SUBSTITUTE(A1,"New York","$New York"),"(250) 888-0000","$(250) 888-0000")
 
Upvote 0
Kuljack, thank you for your reply... Your solution does work, but this method would require that the input Data is manually inputted into the formula versus reading from the cell/Column containing Keywords.

I was able to come up with a formula that does work... take a look and let me know.

=SUBSTITUTE(SUBSTITUTE(B2,A2,CONCATENATE("$",A2)),A3,CONCATENATE("$",A3))
 
Upvote 0
My apologies, I overlooked that initial callout regarding A2:A3. Concatenate isn't all the necessary but is fine. I would lock those cells down however if you're referencing more cells in column B.

=SUBSTITUTE(SUBSTITUTE(B2,$A$2,"$"&$A$2),$A$3,"$"&$A$3)
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,873
Members
449,056
Latest member
ruhulaminappu

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