Formula to remove numbers and return text string

Boanerges_0800

New Member
Joined
Feb 22, 2012
Messages
17
I am looking for a formula to remove the numbers and return just the text string from the following example:

<TABLE style="WIDTH: 378pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=503 x:str><COLGROUP><COL style="WIDTH: 193pt; mso-width-source: userset; mso-width-alt: 9398" width=257><COL style="WIDTH: 185pt; mso-width-source: userset; mso-width-alt: 8996" width=246><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 193pt; HEIGHT: 12.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl23 height=17 width=257>Text and numbers example</TD><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 185pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl23 width=246>Formula Result</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22 height=17>110060 Sls Rev-IntracoFE</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22> Sls Rev-IntracoFE</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22 height=17>* *6020* Net Sales Internal</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22>* ** Net Sales Internal</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22 height=17>** 6020 NET SALES INTERNAL</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22>** NET SALES INTERNAL</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22 height=17>*** 6100 TOTAL NET SALES</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22>*** TOTAL NET SALES</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22 height=17> 700060 COGPrimeIntracoFE</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl22> COGPrimeIntracoFE</TD></TR></TBODY></TABLE>
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I am sorry I do not have the answer but maybe I can point you in a direction to research.

It looks like you need an Array formula. It would probably incorporate the functon ISNUMBER to test each character in the source data.

Best of luck,

GL
 
Upvote 0
Hi Boanerges,

Welcome to the board...

as per your input, if the starting numbers are fixed to 6 & assuming first 18 characters of the text is 18, you can use...

=MID(A1,7,18)

Hope this might help...
 
Upvote 0
Try this User Defined Function

Alt+F11 to open the VBEditor
Insert > Module
Then paste the code below in the right panel

Code:
Function RemoveNumbers(t As String)
    Dim i As Long, newString As String
    
    For i = 1 To Len(t)
        If Not IsNumeric(Mid(t, i, 1)) Then
            newString = newString & Mid(t, i, 1)
        End If
    Next i
    RemoveNumbers = newString
End Function

Assuming your data in A2, A3...

put this formula in B2
=RemoveNumbers(A2)

copy down

M.
 
Upvote 0
Complementing my previous post

To delete leading/trailing spaces you can use in B2
=TRIM(RemoveNumbers(A2))

M.
 
Upvote 0
Hi Marco,
Do you know how I can get the macro that you wrote above to work in all spreadsheets in excel? I pasted it into my personal but it only works there. I want to use it in any sheet I open.
 
Upvote 0
Save it as an add-in in a blank workbook. Then load the add-in.
 
Upvote 0
Maybe (assuming the name of your personal workbook is PERSONAL.XLSB. Check)

=TRIM(PERSONAL.XLSB!RemoveNumbers(A2))

M.
 
Upvote 0

Forum statistics

Threads
1,214,909
Messages
6,122,189
Members
449,072
Latest member
DW Draft

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
Back
Top