PC Review


Reply
Thread Tools Rate Thread

Convert Text to Number

 
 
RH
Guest
Posts: n/a
 
      1st Dec 2008
Can ICF-210-3-10a be converted into a number?
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      1st Dec 2008
easily:

=MID(A1,5,3) returns the 210
=MID(A1,9,1) returns the 3
=MID(A1,11,2) returns the 10

--
Gary''s Student - gsnu200817
 
Reply With Quote
 
RH
Guest
Posts: n/a
 
      1st Dec 2008
Within a named cell range I'm having my formula look-up the model numbers
ICF-210-3-10a, BFF-22-10b. Another cell gathers the look-up information and
creates a calculation. I'm not sure how to turn ICF-210-3-10a into the
number. Could you help?

"Gary''s Student" wrote:

> easily:
>
> =MID(A1,5,3) returns the 210
> =MID(A1,9,1) returns the 3
> =MID(A1,11,2) returns the 10
>
> --
> Gary''s Student - gsnu200817

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      1st Dec 2008
We will convert using a VLOOKUP Table:

Say we have a list of model ids in a column, say column A:

Model
QHO-319-78-78a
ACG-221-42-62r
LZQ-11-37-15g
MCB-43-13-83l
CEJ-101-61-32a
KOR-121-39-68a
UQJ-474-35-94x
DHF-130-66-98z
JYM-263-23-11a
JCD-432-19-40k
EQB-489-81-75x
XGJ-237-47-90j
ZOA-47-55-69u
XGV-185-25-23c
SWE-258-63-68d
XIN-257-10-29o
OXI-217-51-21b
LFU-286-34-79l
CAO-356-99-27d
DHC-280-76-16x
BEJ-195-84-78l
TXT-419-83-11s
FWZ-409-93-51t
MYW-325-43-64v
QMD-180-28-12l
WYF-155-33-57y
OEP-128-85-35g
JNE-308-82-54e
HVY-68-67-44k

we assume that the model ids are unique. In B1 thru B29 enter 1 thru 29.

These are the numbers associated with each text value. Use VLOOKUP() to get
the number from a cell containing the model id.

--
Gary''s Student - gsnu200817


"RH" wrote:

> Within a named cell range I'm having my formula look-up the model numbers
> ICF-210-3-10a, BFF-22-10b. Another cell gathers the look-up information and
> creates a calculation. I'm not sure how to turn ICF-210-3-10a into the
> number. Could you help?
>
> "Gary''s Student" wrote:
>
> > easily:
> >
> > =MID(A1,5,3) returns the 210
> > =MID(A1,9,1) returns the 3
> > =MID(A1,11,2) returns the 10
> >
> > --
> > Gary''s Student - gsnu200817

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      1st Dec 2008
Easily done using a UDF

Function RemAlpha(str As String) As String
'Remove all but numerics from a string
Dim re As Object
Set re = CreateObject("vbscript.regexp")
re.Global = True
re.Pattern = "\D"
RemAlpha = re.Replace(str, "")
End Function

Copy the UDF to a workbook module then using a helper cell enter

=RemAlpha(cellref)


Gord Dibben MS Excel MVP

On Mon, 1 Dec 2008 06:39:02 -0800, RH <(E-Mail Removed)> wrote:

>Can ICF-210-3-10a be converted into a number?


 
Reply With Quote
 
RH
Guest
Posts: n/a
 
      1st Dec 2008
This is great - Thanks so much.

"Gary''s Student" wrote:

> We will convert using a VLOOKUP Table:
>
> Say we have a list of model ids in a column, say column A:
>
> Model
> QHO-319-78-78a
> ACG-221-42-62r
> LZQ-11-37-15g
> MCB-43-13-83l
> CEJ-101-61-32a
> KOR-121-39-68a
> UQJ-474-35-94x
> DHF-130-66-98z
> JYM-263-23-11a
> JCD-432-19-40k
> EQB-489-81-75x
> XGJ-237-47-90j
> ZOA-47-55-69u
> XGV-185-25-23c
> SWE-258-63-68d
> XIN-257-10-29o
> OXI-217-51-21b
> LFU-286-34-79l
> CAO-356-99-27d
> DHC-280-76-16x
> BEJ-195-84-78l
> TXT-419-83-11s
> FWZ-409-93-51t
> MYW-325-43-64v
> QMD-180-28-12l
> WYF-155-33-57y
> OEP-128-85-35g
> JNE-308-82-54e
> HVY-68-67-44k
>
> we assume that the model ids are unique. In B1 thru B29 enter 1 thru 29.
>
> These are the numbers associated with each text value. Use VLOOKUP() to get
> the number from a cell containing the model id.
>
> --
> Gary''s Student - gsnu200817
>
>
> "RH" wrote:
>
> > Within a named cell range I'm having my formula look-up the model numbers
> > ICF-210-3-10a, BFF-22-10b. Another cell gathers the look-up information and
> > creates a calculation. I'm not sure how to turn ICF-210-3-10a into the
> > number. Could you help?
> >
> > "Gary''s Student" wrote:
> >
> > > easily:
> > >
> > > =MID(A1,5,3) returns the 210
> > > =MID(A1,9,1) returns the 3
> > > =MID(A1,11,2) returns the 10
> > >
> > > --
> > > Gary''s Student - gsnu200817

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert text number to number formate thisis_anwar@hotmail.com Microsoft Excel Misc 2 9th Apr 2007 10:48 AM
Convert a number formatted as text to a number in a macro MACRE0 Microsoft Excel Programming 2 22nd Oct 2005 02:51 AM
convert text-format number to number in excel 2000%3f =?Utf-8?B?TGFycnk=?= Microsoft Excel Misc 1 29th Jul 2005 08:18 PM
not able to convert text, or graphic number to regular number in e =?Utf-8?B?a251dHNlbms=?= Microsoft Excel Worksheet Functions 1 2nd Apr 2005 08:41 AM
Convert text number to decimal number Pete Provencher Microsoft Access Queries 4 8th Oct 2003 07:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:19 AM.