A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Alphanumeric



 
 
Thread Tools Display Modes
  #1  
Old July 26th, 2008, 05:31 AM posted to microsoft.public.excel.worksheet.functions
hardeep via OfficeKB.com
external usenet poster
 
Posts: 6
Default Alphanumeric

Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,
UIEIROIWS12556ERE545,ADAS15455212AD4564AD2
And so on. Now I want to extract number from this alphanumeric. Once I have
seen a formula of (SUBSITUTE) in a site it was so simple that any body can
use that formula. Its very short formula. Spouse a1:a1500 has alphanumeric
data put the formula in B1 and drag this formula to B7. In B7 You will find
the only number.
If you can help me in this matter
It Will Be most Appriciate

Regards
Hardeep

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200807/1

  #2  
Old July 26th, 2008, 09:57 AM posted to microsoft.public.excel.worksheet.functions
Bob Phillips
external usenet poster
 
Posts: 5,994
Default Alphanumeric

There are multiple numbers in there, is the result of the first

125
121 or
125589121

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"hardeep via OfficeKB.com" u44683@uwe wrote in message
news:87b52aba76a22@uwe...
Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,
UIEIROIWS12556ERE545,ADAS15455212AD4564AD2
And so on. Now I want to extract number from this alphanumeric. Once I
have
seen a formula of (SUBSITUTE) in a site it was so simple that any body can
use that formula. Its very short formula. Spouse a1:a1500 has alphanumeric
data put the formula in B1 and drag this formula to B7. In B7 You will
find
the only number.
If you can help me in this matter
It Will Be most Appriciate

Regards
Hardeep

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200807/1



  #3  
Old July 26th, 2008, 10:08 AM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Alphanumeric

Hi,

I can't decide form your post exactly what each string (or is it one string)
looks like. Right click your sheet tab, view code and paste this in and run
it. It works on a1:a100 which you can change and outputs the numbers in
column B

Sub extractnumbers()
Set RegExp = CreateObject("vbscript.RegExp")
RegExp.Global = True
RegExp.Pattern = "\d"
Set myrange = ActiveSheet.Range("a1:a100") 'change to suit
For Each c In myrange
Outstring = ""
Set Collection = RegExp.Execute(c.Value)
For Each RegMatch In Collection
Outstring = Outstring & RegMatch
Next
c.Offset(0, 1) = Outstring
Next
End Sub


Mike



"hardeep via OfficeKB.com" wrote:

Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,
UIEIROIWS12556ERE545,ADAS15455212AD4564AD2
And so on. Now I want to extract number from this alphanumeric. Once I have
seen a formula of (SUBSITUTE) in a site it was so simple that any body can
use that formula. Its very short formula. Spouse a1:a1500 has alphanumeric
data put the formula in B1 and drag this formula to B7. In B7 You will find
the only number.
If you can help me in this matter
It Will Be most Appriciate

Regards
Hardeep

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200807/1


  #4  
Old July 26th, 2008, 10:10 AM posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_993_]
external usenet poster
 
Posts: 1
Default Alphanumeric

Just so we know exactly what you are looking for, what numerical result did
you want to appear in B7 for this piece of data?

ADEDO125ADSD589ADF121

Rick


"hardeep via OfficeKB.com" u44683@uwe wrote in message
news:87b52aba76a22@uwe...
Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,
UIEIROIWS12556ERE545,ADAS15455212AD4564AD2
And so on. Now I want to extract number from this alphanumeric. Once I
have
seen a formula of (SUBSITUTE) in a site it was so simple that any body can
use that formula. Its very short formula. Spouse a1:a1500 has alphanumeric
data put the formula in B1 and drag this formula to B7. In B7 You will
find
the only number.
If you can help me in this matter
It Will Be most Appriciate

Regards
Hardeep

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200807/1


  #5  
Old July 26th, 2008, 11:49 AM posted to microsoft.public.excel.worksheet.functions
hardeep via OfficeKB.com
external usenet poster
 
Posts: 6
Default Alphanumeric

I want Numeric characters for example: 125589121,12556545,1545521245642 and
so on.

Thank In Advance

Hardeep

Bob Phillips wrote:
There are multiple numbers in there, is the result of the first

125
121 or
125589121

Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,

[quoted text clipped - 11 lines]
Regards
Hardeep


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200807/1

  #6  
Old July 26th, 2008, 11:49 AM posted to microsoft.public.excel.worksheet.functions
hardeep via OfficeKB.com
external usenet poster
 
Posts: 6
Default Alphanumeric

I want Numeric characters for example: 125589121,12556545,1545521245642 and
so on.

Thank In Advance

Hardeep

Rick Rothstein (MVP - VB) wrote:
Just so we know exactly what you are looking for, what numerical result did
you want to appear in B7 for this piece of data?

ADEDO125ADSD589ADF121

Rick

Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,

[quoted text clipped - 11 lines]
Regards
Hardeep


--
Message posted via http://www.officekb.com

  #7  
Old July 26th, 2008, 12:16 PM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Alphanumeric

Perhaps you may prefer it as a UDF. This must go in a 'General Module'

Function extractnumbers(rng As String)
Set RegExp = CreateObject("vbscript.RegExp")
RegExp.Global = True
RegExp.Pattern = "\d"
For Each RegMatch In RegExp.Execute(rng)
extractnumbers = extractnumbers & RegMatch
Next
End Function

call with
=extractnumbers(a1)
where A1 contains you string

Mike

"Mike H" wrote:

Hi,

I can't decide form your post exactly what each string (or is it one string)
looks like. Right click your sheet tab, view code and paste this in and run
it. It works on a1:a100 which you can change and outputs the numbers in
column B

Sub extractnumbers()
Set RegExp = CreateObject("vbscript.RegExp")
RegExp.Global = True
RegExp.Pattern = "\d"
Set myrange = ActiveSheet.Range("a1:a100") 'change to suit
For Each c In myrange
Outstring = ""
Set Collection = RegExp.Execute(c.Value)
For Each RegMatch In Collection
Outstring = Outstring & RegMatch
Next
c.Offset(0, 1) = Outstring
Next
End Sub


Mike



"hardeep via OfficeKB.com" wrote:

Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,
UIEIROIWS12556ERE545,ADAS15455212AD4564AD2
And so on. Now I want to extract number from this alphanumeric. Once I have
seen a formula of (SUBSITUTE) in a site it was so simple that any body can
use that formula. Its very short formula. Spouse a1:a1500 has alphanumeric
data put the formula in B1 and drag this formula to B7. In B7 You will find
the only number.
If you can help me in this matter
It Will Be most Appriciate

Regards
Hardeep

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200807/1


  #8  
Old July 26th, 2008, 12:55 PM posted to microsoft.public.excel.worksheet.functions
Bob Phillips
external usenet poster
 
Posts: 5,994
Default Alphanumeric

Mike's UDF looks the way to go then.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"hardeep via OfficeKB.com" u44683@uwe wrote in message
news:87b8780eb72c9@uwe...
I want Numeric characters for example: 125589121,12556545,1545521245642 and
so on.

Thank In Advance

Hardeep

Bob Phillips wrote:
There are multiple numbers in there, is the result of the first

125
121 or
125589121

Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,

[quoted text clipped - 11 lines]
Regards
Hardeep


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200807/1



  #9  
Old July 26th, 2008, 01:15 PM posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
external usenet poster
 
Posts: 3,719
Default Alphanumeric

On Sat, 26 Jul 2008 04:31:22 GMT, "hardeep via OfficeKB.com" u44683@uwe
wrote:

Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,
UIEIROIWS12556ERE545,ADAS15455212AD4564AD2
And so on. Now I want to extract number from this alphanumeric. Once I have
seen a formula of (SUBSITUTE) in a site it was so simple that any body can
use that formula. Its very short formula. Spouse a1:a1500 has alphanumeric
data put the formula in B1 and drag this formula to B7. In B7 You will find
the only number.
If you can help me in this matter
It Will Be most Appriciate

Regards
Hardeep



For a worksheet function (formula) solution:

(from Harlan Grove):

First, create a NAMEd Formula

Names in Workbook: Seq
Refers to: =ROW(INDEX($1:$65536,1,1):INDEX($1:$65536,255,1))

This ARRAY FORMULA
(committed with CTRL+SHIFT+ENTER, instead of just ENTER)
removes ALL non-numerics from a string.

B1:
=SUM(IF(ISNUMBER(1/(MID(A1,seq,1)+1)),MID(A1,seq,1)*
10^MMULT(-(seqTRANSPOSE(seq)),-ISNUMBER(1/(MID(A1,seq,1)+1)))))

===================================
For a UDF

alt-F11 opens the VBEditor
Ensure your project is highlighted in the Project Explorer window, then
Insert/Module and paste the code below into the window that opens.

To use this UDF:

=Digits(str) where str is either the quoted string, or a cell reference
containing your string. e.g. =Digits(A1) will return all the digits in A1.

If you wish this returned as a "Number" rather than as "Text", precede the
formula with a double unary:

=--Digits(A1)

=====================================
Option Explicit
Function Digits(str As String)
Dim re As Object
Set re = CreateObject("vbscript.regexp")
re.Global = True
re.Pattern = "\D+"
Digits = re.Replace(str, "")
End Function
===========================
--ron
  #10  
Old July 26th, 2008, 01:30 PM posted to microsoft.public.excel.worksheet.functions
hardeep via OfficeKB.com
external usenet poster
 
Posts: 6
Default Alphanumeric

Thanks Sir

Hardeep kanwar

Ron Rosenfeld wrote:
Dear sir
I have list of 15000 of Alphanumeric data for ex. ADEDO125ADSD589ADF121,

[quoted text clipped - 9 lines]
Regards
Hardeep


For a worksheet function (formula) solution:

(from Harlan Grove):

First, create a NAMEd Formula

Names in Workbook: Seq
Refers to: =ROW(INDEX($1:$65536,1,1):INDEX($1:$65536,255,1))

This ARRAY FORMULA
(committed with CTRL+SHIFT+ENTER, instead of just ENTER)
removes ALL non-numerics from a string.

B1:
=SUM(IF(ISNUMBER(1/(MID(A1,seq,1)+1)),MID(A1,seq,1)*
10^MMULT(-(seqTRANSPOSE(seq)),-ISNUMBER(1/(MID(A1,seq,1)+1)))))

===================================
For a UDF

alt-F11 opens the VBEditor
Ensure your project is highlighted in the Project Explorer window, then
Insert/Module and paste the code below into the window that opens.

To use this UDF:

=Digits(str) where str is either the quoted string, or a cell reference
containing your string. e.g. =Digits(A1) will return all the digits in A1.

If you wish this returned as a "Number" rather than as "Text", precede the
formula with a double unary:

=--Digits(A1)

=====================================
Option Explicit
Function Digits(str As String)
Dim re As Object
Set re = CreateObject("vbscript.regexp")
re.Global = True
re.Pattern = "\D+"
Digits = re.Replace(str, "")
End Function
===========================
--ron


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200807/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.