Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a plus sign to every word in a cell using Excel or Google SpreadSheets formula

I have a column with the name of different products, for example:

   A
1 red car
2 blue whale
3 red carpet in the closet
4 star wars dvd extra especial thing
5 whatever with your however

I would like in column B:

    B
1 +red +car
2 +blue +whale
3 +red +carpet +in +the +closet
4 +star +wars +dvd +extra +especial +thing
5 +whatever +with +your +however

I´m using Google Spreadsheets, but a solution to Excel would work just fine!

If the only way to accomplish that is using a custom formula, I would prefer a Google Spreadsheets formula. Although, I would really like to know a native formula if possible.

like image 546
user3347814 Avatar asked Dec 25 '22 13:12

user3347814


2 Answers

Here you go. Put this in cell B1:

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

Now copy downward.

like image 158
Excel Hero Avatar answered Dec 27 '22 01:12

Excel Hero


To avoid have to fill-down and have to repeat this as new data is entered, on Google Sheets try

=ArrayFormula("+"&REGEXREPLACE(FILTER(E:E,LEN(E:E))," "," \+") )
like image 20
Rubén Avatar answered Dec 27 '22 01:12

Rubén