Extract until first letter

sshinshaw

New Member
Joined
Apr 26, 2019
Messages
3
I have a string of numbers and letters and need to extract everything after the first letter.

Example

456trust
4file
5867hampton
24grate
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Do you only need the letters, right?
 
Last edited:
Upvote 0
So you want to see trust instead of 456trust, file instead of 4file (etc etc)?

Try this UDF:
Code:
Function NoNumbers(txt As String) As String
    With CreateObject("VBScript.RegExp")
        .Global = True
        .Pattern = "\d"
        NoNumbers = Trim(.Replace(txt, ""))
    End With
End Function
Then =NoNumbers(A1)
Will give you "trust" if A1 is the cell containing "456trust" for example.

EDIT: Nested a trim to tidy.
 
Last edited:
Upvote 0
Click (Ctrl+Shift+Enter) to the end of line formula:
Code:
{=RIGHT(A1,LEN(A1)-MAX(IFERROR(FIND({1,2,3,4,5,6,7,8,9,0}, A1, ROW(INDIRECT("1:" & LEN(A1)))), 0)))}
 
Upvote 0
Hi,

Array formula**:

=MID(A1,MATCH(1,-MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))+1,99)

Regards


**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
 
Upvote 0
I did not like it, but it's a regular formula

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,0,""),1,""),2,""),3,""),4,""),5,""),6,""),7,""),8,""),9,"")
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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