Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
mtbakerstu
 
Posts: n/a
Default A smart way to parse alpha numerics?

Does anyone know of an efficient way to separate letters and numbers
which exist in one cell into different cells for each respective part?
It has been suggested to me that there should be a way to do this in
Excel. I'm using Excel 2000.

Thanks Everyone!

mtbakerstu

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default A smart way to parse alpha numerics?

It can be done, but the solution you use will depend on the layout of
the data, how the alphas and numerics are mixed in the string. Please
post some representative examples.

  #3   Report Post  
Posted to microsoft.public.excel.misc
Jim May
 
Posts: n/a
Default A smart way to parse alpha numerics?

Enter these two UDF's in a Standard module:

Public Function GetTextPart(c) As String
Dim i As Integer
Dim MyString As String

'Templatebuilder
'Returning text value from string'
MyString = ""
For i = 1 To Len(c)
If InStr(1, "abcdefghijklmnopqrstuvwxyz -[]", Mid(c, i, 1),
vbTextCompare) 0 Then
MyString = MyString + Mid(c, i, 1)
End If
Next i
GetTextPart = MyString
End Function

Public Function GetNumPart(c) As String
Dim i As Integer
Dim MyString As String

'Templatebuilder
'Returning numeric value from string'
MyString = ""
For i = 1 To Len(c)
If InStr(1, "0123456789", Mid(c, i, 1), vbTextCompare) 0 Then
MyString = MyString + Mid(c, i, 1)
End If
Next i
GetNumPart = MyString
End Function

"mtbakerstu" wrote:

Does anyone know of an efficient way to separate letters and numbers
which exist in one cell into different cells for each respective part?
It has been suggested to me that there should be a way to do this in
Excel. I'm using Excel 2000.

Thanks Everyone!

mtbakerstu


  #4   Report Post  
Posted to microsoft.public.excel.misc
mtbakerstu
 
Posts: n/a
Default A smart way to parse alpha numerics?

Thanks Dave, here are some examples:

129A
44A
44A
44A
VXA44AG
44A
VXB180
169
169
169
D129

  #5   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default A smart way to parse alpha numerics?

Are the numbers always together like in your example and not like 44A55B66?
If so this somewhat ugly array formula will work

=--MID(A1,MATCH(FALSE,ISERROR(--MID(A1,ROW(INDIRECT("1:100")),1)),0),100-SUM(--ISERROR(--MID(A1,ROW(INDIRECT("1:100")),1))))

entered with ctrl + shift & enter

another one by Domenic I believe

=LOOKUP(9.99999999999999E+307,--MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"012345 6789")),ROW(INDEX(A:A,1):INDEX(A:A,LEN(A1)))))

then to get the text just use

=SUBSTITUTE(A1,B1,"")

where B1 is the cell with any of the formulas





--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com




"mtbakerstu" wrote in message
oups.com...
Thanks Dave, here are some examples:

129A
44A
44A
44A
VXA44AG
44A
VXB180
169
169
169
D129



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
How do I count alpha codes in a range of cells in a row? Barbarosa Excel Discussion (Misc queries) 1 February 7th 06 04:19 PM
smart tags and stock updates Tom_in_Jersey Excel Discussion (Misc queries) 0 December 14th 05 09:59 PM
Person Names Smart Tag problems Goowa Excel Discussion (Misc queries) 0 November 18th 05 04:50 PM
smart tags Tom_in_Jersey Excel Discussion (Misc queries) 2 August 29th 05 09:56 PM
Adding Smart Tags to an unrecognized cell reference SauveC Excel Discussion (Misc queries) 3 February 12th 05 02:01 AM


All times are GMT +1. The time now is 07:53 AM.

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"