Description:
Do your Excel cells contain a mix of letters, symbols, and numbers, but you only want to keep the numbers?
For example, you may want to turn AB-123C into 123, or Order#4589 into 4589.
Here are three ways to remove non-numeric characters from cells in Excel.
Method 1: Use a Formula
=TEXTJOIN("",TRUE,IFERROR(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)*1,""))
Method 2: Use VBA Code
Function KeepNumbers(Cell As Range) As String
Dim i As Long
Dim Result As String
Dim Ch As String
For i = 1 To Len(Cell.Value)
Ch = Mid(Cell.Value, i, 1)
If Ch Like "#" Then
Result = Result & Ch
End If
Next i
KeepNumbers = Result
End Function
Method 3: Use Kutools for Excel
Get 300+ advanced Excel tools plus AI-powered features to simplify tasks and work more efficiently.
Share this link via
Or copy link

























