Separate text from numbers in a string?

LoriD

Board Regular
Joined
Apr 1, 2002
Messages
148
Is there a way to separate text from numbers, (other than text to columns)
My data is all different lengths, nothing consistent,plus I want to put the separated data in another column.
I'm hoping there is a formula???
Thanks in advance for your help.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi,

Follow up questions on the issue:

After I get the column C with the above 3 numbers, is there a formula or macro that I can use to split it in to three different columns. I would prefer a formula or macro to do it, other than use the "Text to column", since I need to split many column of these kind of data at the same time.

Thanks ahead!

Li
 
Upvote 0
Hi,

Follow up questions on the issue:

After I get the column C with the above 3 numbers, is there a formula or macro that I can use to split it in to three different columns. I would prefer a formula or macro to do it, other than use the "Text to column", since I need to split many column of these kind of data at the same time.

Thanks ahead!

Li
Will columns C always have three numbers or be blank? Or will it sometimes have 1 or 2 numbers?

What version of Excel are you using?
 
Last edited:
Upvote 0
Sorry, I meant Column C always has 3 numbers.
Try these formulas (copied down). Note also that I have altered my column C formula from my earlier post.

Excel Workbook
ABCDEF
1Construction in Progress / Adjustments 449.4Construction in Progress / Adjustments 449.4    
2Property, Plant, & Equipment 6,265.2Property, Plant, & Equipment 6,265.2
3Total Property, Plant, & Equipment 6,714.7 3,791.4 46.6 2,876.7Total Property, Plant, & Equipment 6,714.73,791.4 46.6 2,876.73,791.446.62,876.7
4Product Trade Names 0.0Product Trade Names 0.0
Substitute
 
Upvote 0
hello ... newbie here :)

need help not only to separate the text from number, but also need the number data as well...

for example:
A1
AX10
FR100

then i need the data to be separated to text and number:
A 1
AX 100
FR 1000

thanks in advance
 
Upvote 0
hello ... newbie here :)

need help not only to separate the text from number, but also need the number data as well...

for example:
A1
AX10
FR100

then i need the data to be separated to text and number:
A 1
AX 100
FR 1000

thanks in advance

<TABLE style="WIDTH: 144pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=192><COLGROUP><COL style="WIDTH: 48pt" span=3 width=64><TBODY><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; WIDTH: 48pt; HEIGHT: 14.4pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 height=19 width=64> </TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" id=td_post_2300954 class=xl63 width=64> </TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 width=64> </TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl64 height=19>A1
</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63>A</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 align=right>1</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl64 height=19>AX10</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63>AX</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 align=right>10</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl64 height=19>FR100</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" id=td_post_2300954 class=xl63>FR</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 align=right>100</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 height=19> </TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63> </TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63> </TD></TR></TBODY></TABLE>

B2, just enter and copy down:

=TRIM(LEFT(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")-1)))

C2, just enter and copy down:

=SUBSTITUTE(A2,B2,"")+0

You might want to omit the +0 bit if text numbers are OK.
 
Upvote 0
awesome!!!! :eeek:
thank you very very much ... though i still don't quite understand the formula :biggrin:

Explaining one's own invention (a few years back though) should be possible...

Given that:

(a) FIND (also SEARCH) yields the start position of the search string within the target string. If the search string is not part of the target string, we get a #VALUE! error.

(b) MIN returns the first error value it encounters if any.

(c) FIND is given the set of digits to look for, i.e., {0,1,2,3,4,5,6,7,8,9}, in the target string to which a string of all digits appended. The latter in order to prevent #VALUE! errors.

If we evaluate

MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789"))-1

for the target string of A1, we get successively:

MIN(FIND({0,1,2,3,4,5,6,7,8,9},"A10123456789"))-1

MIN({3,2,5,6,7,8,9,10,11,12})-1)

where digit-0 at position 3, digit-1 at position 2, digit-2 at position 5, etc.

2-1

1, which is given to LEFT as the number of chars parameter.

Note. The formula sghould be:

=TRIM(LEFT(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789"))-1))

The earlier version has one paren less, which makes it unnecessarily calculation-intensive.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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