Replacing a text variable with a list of keywords

rc5781

New Member
Joined
Nov 28, 2005
Messages
1
I was wondering if anyone could tell me how to do the following:

Let's say I have a phrase such as "I like eating $$$$$."

How can I automatically replace the $$$$$ (a text variable) with a list of words such as "burgers", "hot dogs", "pizza" so the result would be the following in different cells?

I like eating burgers.
I like eating hot dogs.
I like eating pizza.

Thanks in advance...
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I assume that you will have a separate table of words to substitute.

Then simply substitute the $ with the match item in the corresponding side table.

Formula in B1: =SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-FIND("#",SUBSTITUTE(A1," ","#",2))),F1)

where F1 contains the first substituting word.

Then copied down.

Note: If your phrase is not "I Like $$$", then replace the number 2 in the Substitute function, with the number of spaces between words in your phrase.
AddToFormulas.xls
ABCDEF
1I like $$$I like burgersburgers
2I like $$$$$I like friesfries
3I like $$I like pizzapizza
Sheet3


Does this work for you.?
 
Upvote 0

Forum statistics

Threads
1,207,391
Messages
6,078,215
Members
446,321
Latest member
thecachingyeti

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