Replacing spaces with data from another cell

M

Michael

Hello,

I'm trying to create some tracking URLs and I am was hoping that there was
an easier way to do this. I have keywords that vary between 2 and 5 words
long. I need to enter unique code before, after and in between each keyword.
I.E.

Apples Oranges Bananas Pears =
code1applescode2orangescode2bananascode2pearscode3 . Is there an easy way I
can create this with a formula?

Thank you for your help,
 
R

Rik_UK

Assuming the key words occur in a single cell (say a1) then the following
will work

="code1"&SUBSTITUTE(TRIM(A1)," ","code2")&"code3"

Hope it helps...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top