How to remove extra characters from a data set when transferring data via text to column

thekodak

New Member
Joined
Jun 21, 2018
Messages
6
Here's the situation. we are moving to a new CRM (or to a single REAL CRM if you want to be honest) and we need each phone number in a new column with out the jargon (random notes) behind it.

The phone number are in one column now, separated by an alt return. The phone number look like the sample below, with the phone number in the front of each row with varying jargon in back depending on who was maintaining it over the last 15 years. Each cell of phone numbers could have up to 20 numbers in it.
To upload into the new CRM, I need each phone number in its own separate column with no jargon.

I can use "text to Columns" to delimit using the ALT return (0010), but that brings over the jargon. I was going use some code in the transferred cells to clean up the phone numbers but when I use text to columns it removes any of the formulas in those cells.

We have thousands of data points. I need some help. If the staff has to clean up by hand they will kill me. :-(
I'm using office 365 business and windows 10.

Here's a sampling of the data.

(123) 456-7890 (ML) (M) (99%) -bob
(231) 456-7980 (PL) (L) (88%)
(123) 456-9870 (TH) (F)(72%)
(123) 456-0987 (KO) -fax
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi,

If your Phone Numbers are Always in this format (###) ###-####

Would this work for you?


Book1
ABCDE
1(123) 456-7890 (ML) (M) (99%) -bob (231) 456-7980 (PL) (L) (88%) (123) 456-9870 (TH) (F)(72%) (123) 456-0987 (KO) -fax(123) 456-7890(231) 456-7980(123) 456-9870(123) 456-0987
Sheet101
Cell Formulas
RangeFormula
B1=LEFT(TRIM(MID(SUBSTITUTE($A1,CHAR(10),REPT(" ",500)),COLUMNS($B1:B1)*500-499,500)),14)


B1 formula copied across as far as needed.
 
Upvote 0
after your replace alt 0010 with a single space character you might have 100 bob 200 fred 300 harry

in a single cell

use a macro to find non numeric characters and delete them leaving you with 100 200 300

the find a double space and replace with a single space
 
Upvote 0
You clicked "Thanks" for my post #3 , but I don't know if it's working for you.
I've re-read your OP, since there may be up to 20 Phone Numbers in the cell, choose one of these updated formulas, they'll accommodate Longer strings.


Book1
ABCDE
1(123) 456-7890 (ML) (M) (99%) -bob (231) 456-7980 (PL) (L) (88%) (123) 456-9870 (TH) (F)(72%) (123) 456-0987 (KO) -fax(123) 456-7890(231) 456-7980(123) 456-9870(123) 456-0987
2(123) 456-7890 (ML) (M) (99%) -bob (231) 456-7980 (PL) (L) (88%) (123) 456-9870 (TH) (F)(72%) (123) 456-0987 (KO) -fax(123) 456-7890(231) 456-7980(123) 456-9870(123) 456-0987
Sheet101
Cell Formulas
RangeFormula
B1=LEFT(TRIM(MID(SUBSTITUTE($A1,CHAR(10),REPT(" ",1000)),COLUMNS($B1:B1)*1000-999,1000)),14)
B2=LEFT(TRIM(MID(SUBSTITUTE($A2,CHAR(10),REPT(" ",LEN($A2))),COLUMNS($B2:B2)*LEN($A2)-LEN($A2)+1,LEN($A2))),14)


Same as before, formulas copied across as far as needed.
B2 formula is a bit longer, but is not limited by the length of the Text string in the cell.
 
Last edited:
Upvote 0
You're very welcome, welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top