Separating cell values based on numbers, letters, and symbols

sungraph

New Member
Joined
Jul 9, 2008
Messages
3
Hi everyone,
I have a spreadsheet that contains a column of data that is a mixture of letters, numbers and symbols all based on the last row of the keyboard. The data looks like this:

23C\v
5B\n
12<\.
23Z?\zc

This data is used to create whole numbers and fractions when exported to another program. (The numbers represent the whole number and the case-sensitive letters and symbols represent the numerators and denominators.)

I need to be able to separate the numerical portion of the cells from the rest by adding a space between the numbers and everything else. (23Z?\zc will become 23 Z?\zc) The backslash will always be included, but there could be one or two numbers or symbols before and after the backslash. The characters before the backslash can include the following characters between the quote marks: "ZXCVBNM<>?" The characters after the backslash can include: "zxcvbnm,./"

Is there any formula that can be used to separate this data or will I have to record macros searching for the various combinations?

Any help is much appreciated!
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
If there can't be more than 2 numbers at the beginning try:

=SUBSTITUTE(A1,MID(A1,1,1+(ISNUMBER(MID(A1,2,1)+0))),MID(A1,1,1+(ISNUMBER(MID(A1,2,1)+0)))&" ")
 
Upvote 0
Thank you so much! This is wonderful and will fix almost everything. Could it be modified to work if there are 3 numbers at the beginning?
 
Upvote 0
Hi sungraph

For up to 3 digits at the beggining try:

=LOOKUP(1000,--LEFT(A1,{1,2,3}))
 
Upvote 0
Using pgc01's clever formula, my formula would be:

=SUBSTITUTE(A1,LOOKUP(1000,--LEFT(A1,{1,2,3})),LOOKUP(1000,--LEFT(A1,{1,2,3}))&" ")
 
Upvote 0
Hi sungraph

Now I see that I did not read your OP with attention. I had understood it was just to extract the number and not to insert a space between the number and the rest.

I see Andrew posted already a solution, here's another:

=REPLACE(A1,LOOKUP(1000,--LEFT(A1,{1,2,3}),{2,3,4}),0," ")
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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