ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Stripping digits from a column (https://www.excelbanter.com/new-users-excel/177815-stripping-digits-column.html)

Mike[_8_]

Stripping digits from a column
 
Hi,
I've a column containing alphanumeric text as 200731705A832565410B12345678.
Out of this text, I need only the 9 right most digits.
How do I go by?
TIA,
Mark


BernieG

Stripping digits from a column
 
Assuming the text is in cell A1, type =RIGHT(A1,9)

If this doesn't work, the text may contain non-printing characters. If so,
type
=RIGHT(CLEAN(C9),9)

Hope this helps.

--
BernieG


"Mike" wrote:

Hi,
I've a column containing alphanumeric text as 200731705A832565410B12345678.
Out of this text, I need only the 9 right most digits.
How do I go by?
TIA,
Mark


Gary''s Student

Stripping digits from a column
 
If yu have a set of mixed numbers and letters and want only the nine-most
numbers, then:

=RIGHT(returnnumerals(A2),9)

where the UDF is:


Public Function ReturnNumerals(rng As Range) As String
Dim sStr As String, i As Long, sStr1 As String
Dim sChar As String
sStr = rng.Value
For i = 1 To Len(sStr)
sChar = Mid(sStr, i, 1)
If sChar Like "[0-9]" Then
sStr1 = sStr1 & sChar
End If
Next
ReturnNumerals = sStr1
End Function
--
Gary''s Student - gsnu200770


"BernieG" wrote:

Assuming the text is in cell A1, type =RIGHT(A1,9)

If this doesn't work, the text may contain non-printing characters. If so,
type
=RIGHT(CLEAN(C9),9)

Hope this helps.

--
BernieG


"Mike" wrote:

Hi,
I've a column containing alphanumeric text as 200731705A832565410B12345678.
Out of this text, I need only the 9 right most digits.
How do I go by?
TIA,
Mark



All times are GMT +1. The time now is 08:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com