ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Replacing spaces with data from another cell (https://www.excelbanter.com/excel-worksheet-functions/251148-replacing-spaces-data-another-cell.html)

Michael

Replacing spaces with data from another cell
 
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,



Pete_UK

Replacing spaces with data from another cell
 
Assuming your text is in A1, try this:

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

and then copy down as required.

Hope this helps.

Pete

On Dec 15, 10:46*pm, Michael
wrote:
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,




All times are GMT +1. The time now is 07:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com