30

I've a huge data in excel file.

For eg: say i've a word like paul son,i've to make it as paulson.

input:paul son output:paulson.

In some cells ,i've data like mic-li,when this type of words come,it should not replace any thing,it should only remove spaces in between words.

chris neilsen
  • 52,446
  • 10
  • 84
  • 123

4 Answers4

57

Suppose the data is in the B column, write in the C column the formula:

=SUBSTITUTE(B1," ","")

Copy&Paste the formula in the whole C column.

edit: using commas or semicolons as parameters separator depends on your regional settings (I have to use the semicolons). This is weird I think. Thanks to @tocallaghan and @pablete for pointing this out.

vulkanino
  • 9,074
  • 7
  • 44
  • 71
37

It is SUBSTITUTE(B1," ",""), not REPLACE(xx;xx;xx).

Olle Sjögren
  • 5,315
  • 3
  • 31
  • 51
Richard
  • 371
  • 1
  • 3
  • 3
  • 3
    This is more of a comment than an answer, so it should be posted as a comment to the answer it concerns (when you have the rep to do so...) – Olle Sjögren Jan 20 '13 at 23:28
6

Steps (1) Just Select your range, rows or column or array , (2) Press ctrl+H , (3 a) then in the find type a space (3 b) in the replace do not enter anything, (4)then just click on replace all..... you are done.

kvn4kevin
  • 61
  • 1
  • 2
0

Just wanted to add on to vulkanino's answer... now 10 years later ha. This is what I was looking for maybe someone else is too. You can also build on multiple =SUBSTITUTE() functions.

Here is what I used to format a list of names for Active Directory accounts. B2 is where the name would go. I wanted to change the space between the First name and last to a period and omit any hyphens from names.

=SUBSTITUTE(SUBSTITUTE(B2, " ", "."), "-", "")

For example the line above would look like this:

First Last-Name => First.LastName

, "-", "") This part removes the hyphen.

(B2, " ", ".") This part selects the cell to modify and changes empty space to a period.

=SUBSTITUTE(SUBSTITUTE(...)...) I used two substitute functions one inside the other.

R08
  • 1
  • 1