Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default Separate Text into numbers and alphabets

I have strings in Col A which has few numbers then few alphabets and then
again a few numbers.

Eg.
123ABCygh97t945729572
1B6
341gagjKHGL8793

I want to separate the first set of numbers in Col B, set of alphabets in
Col C, and the second set of numbers in Col C.

I want to do this using formulae...
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Separate Text into numbers and alphabets

On Tue, 9 Sep 2008 17:45:01 -0700, Sheeloo
wrote:

I have strings in Col A which has few numbers then few alphabets and then
again a few numbers.

Eg.
123ABCygh97t945729572
1B6
341gagjKHGL8793

I want to separate the first set of numbers in Col B, set of alphabets in
Col C, and the second set of numbers in Col C.

I want to do this using formulae...


Your first example has 5 segments. How do you want that divided?

If you just have three segments <digits<letters<digits

You could use:

A1: Original string

B1 and C1 must be entered as array formulas (hold down <ctrl<shift while
hitting <enter)

B1: =LEFT(A1,-1+MATCH(FALSE,ISNUMBER(-MID(A1,ROW(INDIRECT("1:255")),1)),0))

C1:
=LEFT(SUBSTITUTE(A1,B1,"",1),-1+MATCH(TRUE,ISNUMBER(
-MID(SUBSTITUTE(A1,B1,"",1),ROW(INDIRECT("1:255")), 1)),0))

D1: =SUBSTITUTE(A1,B1&C1,"",1)

But if your first example was not a typo, then the formula in D1 will need to
change.
--ron
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default Separate Text into numbers and alphabets

Thanks Ron,

Yes, first string had a typo.

The reason I thought of this was because in another post Mike (in the post -
Alphanumeric Sorting - numeric alpha numeric) had asked about sorting a range
of values which have three segments like I mentioned.

Once they are separated sorting is easy.

Thanks for your help..


"Ron Rosenfeld" wrote:

On Tue, 9 Sep 2008 17:45:01 -0700, Sheeloo
wrote:

I have strings in Col A which has few numbers then few alphabets and then
again a few numbers.

Eg.
123ABCygh97t945729572
1B6
341gagjKHGL8793

I want to separate the first set of numbers in Col B, set of alphabets in
Col C, and the second set of numbers in Col C.

I want to do this using formulae...


Your first example has 5 segments. How do you want that divided?

If you just have three segments <digits<letters<digits

You could use:

A1: Original string

B1 and C1 must be entered as array formulas (hold down <ctrl<shift while
hitting <enter)

B1: =LEFT(A1,-1+MATCH(FALSE,ISNUMBER(-MID(A1,ROW(INDIRECT("1:255")),1)),0))

C1:
=LEFT(SUBSTITUTE(A1,B1,"",1),-1+MATCH(TRUE,ISNUMBER(
-MID(SUBSTITUTE(A1,B1,"",1),ROW(INDIRECT("1:255")), 1)),0))

D1: =SUBSTITUTE(A1,B1&C1,"",1)

But if your first example was not a typo, then the formula in D1 will need to
change.
--ron

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Separate Text into numbers and alphabets

Download and install the free add-in Morefunc.xll from:
http://www.download.com/Morefunc/300...-10423159.html
then use the following formulas

In B1: =TRIM(LEFT(REGEX.SUBSTITUTE(A1,"[A-Z,a-z]",REPT(" ",99)),99))
In C1: =REGEX.SUBSTITUTE(A1,"[0-9]","")
In D1: =SUBSTITUTE(A1,B1&C1,"")


"Sheeloo" wrote:

I have strings in Col A which has few numbers then few alphabets and then
again a few numbers.

Eg.
123ABCygh97t945729572
1B6
341gagjKHGL8793

I want to separate the first set of numbers in Col B, set of alphabets in
Col C, and the second set of numbers in Col C.

I want to do this using formulae...

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Separate Text into numbers and alphabets

On Tue, 9 Sep 2008 19:39:00 -0700, Teethless mama
wrote:

Download and install the free add-in Morefunc.xll from:
http://www.download.com/Morefunc/300...-10423159.html
then use the following formulas

In B1: =TRIM(LEFT(REGEX.SUBSTITUTE(A1,"[A-Z,a-z]",REPT(" ",99)),99))
In C1: =REGEX.SUBSTITUTE(A1,"[0-9]","")
In D1: =SUBSTITUTE(A1,B1&C1,"")



Perhaps simpler if you are going to use the morefunc add-in:

B1: =REGEX.MID(A1,"\d+")
C1: =REGEX.MID(A1,"\D+")

D1: =REGEX.MID(A1,"\d+",2)

--ron


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Numbers to Alphabets rk0909 Excel Discussion (Misc queries) 10 January 12th 08 11:38 AM
HOW TO CHAGE COLUMN ADDRESS FROM NUMBERS TO ALPHABETS koneru Excel Discussion (Misc queries) 2 January 9th 08 05:06 PM
how to change the alphabets to numbers and numbers to alphabets in Igneshwara reddy[_2_] Excel Worksheet Functions 2 September 20th 07 04:56 PM
how do i change column numbers to alphabets from numerals C Excel Discussion (Misc queries) 2 June 12th 07 11:03 PM
columns showing numbers instead of alphabets inenewbl Excel Discussion (Misc queries) 1 January 26th 07 12:36 PM


All times are GMT +1. The time now is 02:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"