Numeric data

  • Thread starter Thread starter Ams
  • Start date Start date
A

Ams

Dear all

Pleasae guide me to find out numeric data in cell where the cell
contains both aplha & numeric value.

Like i want to take out pincode from one single cell where in the
location and pincode is mentioned in a single cell

Eg ( Mumbai 400018 )

Serch Result shud b 400018


Thanxs in advance
 
Are pin codes always 6 digits long? If so...

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

If not, you will have to give us several examples so we can see if any
patterns exist (for example, number always at the end of the text, or number
is always followed by a space, and so on). By the way, it is not clear from
your example if your text is surrounded by parentheses or not.

Rick
 
Pleasae guide me to find out numeric data in cell where the cell
contains both aplha & numeric value.

Sounds like a job for the Split function

Function GetNumeric(S as string)
Dim i as Integer
Dim Lumps as Variant
Lumps = Split(S," ") ' or delimiter of your choice, but your example
used a space
For i = 0 to Ubound Lumps
If Isnumeric(Lumps(i)) then ' found a number
GetNumeric = Val(Lumps(i))
Exit Function
End If
Next
' If we get here, there wasn't one
GetNumeric = "<Invalid Data>"
End Function
 
Back
Top