If you have a column of credit card numbers or phone numbers where blanks have been included and you want to remove the blanks, the SUBSTITUTE function can be used. This replaces existing text with new text in a text string, so in this case we want to replace a blank with no space.
The syntax for the SUBSTITUTE function is =SUBSTITUTE(text,oldtext,newtext,instancenum)
So in the example here, the formula would be
=SUBSTITUTE(B2,” “,””) which could then be copied down for all the other numbers.
You could then, if you like, copy your new column and paste values on to the original column.
Find out more about our Excel training courses Sydney, Australia.