Getting rid of letters and leave only numbers??

kelvin2088

Board Regular
Joined
Mar 11, 2010
Messages
78
Hello experts!

I have thousands rows of data strings like following:

DR612491
AAL313490
7132134ALLI
AALC8214LAN
AD8123LKN8912
.....


I'm wondering if there's any function can help me trim those strings to only numbers? (getting rid of all letters, both in front, back and middle)

so that I can have output like following:
612491
313490
7132134
8214
81238912

Ahh...this is driving me crazy:eek:
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

BobUmlas

Well-known Member
Joined
Mar 14, 2002
Messages
1,181
You can use this UDF:

Function Nos(Rg As Range)
Dim n As Integer
For i = Len(Rg) To 1 Step -1
If Asc(Mid(Rg.Value, i, 1)) < 58 And Asc(Mid(Rg.Value, i, 1)) > 47 Then
Nos = Mid(Rg.Value, i, 1) * 10 ^ n + Nos
n = n + 1
End If
Next
End Function

then enter =NOS(A1) for example...
 
Upvote 0

pboltonchina

Well-known Member
Joined
Apr 24, 2008
Messages
1,101
ASAP Utilities will do this. Select Text, Advanced character removal and replacement, select None, then click the 1,2,3 button at the bottom, then Inverse and OK.

ASAP Utilities is a free add in for excel available to download from http://www.asap-utilities.com
 
Upvote 0

kelvin2088

Board Regular
Joined
Mar 11, 2010
Messages
78
That sounds very promising!
I'll give it a try. (Not sure if i can install this add-on since everything's blocked on company computer :()




ASAP Utilities will do this. Select Text, Advanced character removal and replacement, select None, then click the 1,2,3 button at the bottom, then Inverse and OK.

ASAP Utilities is a free add in for excel available to download from http://www.asap-utilities.com
 
Upvote 0

Forum statistics

Threads
1,191,200
Messages
5,985,238
Members
439,953
Latest member
suchitha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top