Microsoft Excel – removing blanks from credit card numbers, phone numbers, etc.

 

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.

Find out more about our Excel training courses London area of the UK, or our Excel training courses Dorset, Hampshire and Wiltshire areas.

About jdonbavand

I am a trainer of Microsoft Office, Microsoft Project and Crystal Reports. I have called my blog "If Only I'd Known That...." because I hear it so many times in training sessions. In fact, if only I had a £100 (or 150 Aussie dollars)for every time someone says "If only I'd known that." ....
This entry was posted in Microsoft Excel, Microsoft Excel 2003, Microsoft Excel 2007, Microsoft Excel 2010, Microsoft Excel 2013 and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s