Removing numerical text values and leaving only alpha letters

Executioner

Board Regular
Joined
Sep 26, 2005
Messages
166
Hi everyone,
I have one column A of data that looks like this:

AAL2074883-XX / A
AAL2075713-XX / A
AAL2075715-XX / A
AP2925411 / D
AP2928142 / H
AP2928142 / J

I have inserted a new column B so I can filter the alpha characters only. In the example above, it should look like:
Code:
A                        B
AAL2074883-XX /  A	AAL
AAL2075713-XX /  A	AAL
AAL2075715-XX /  A	AAL
AP2925411 /  D	        AP
AP2928142 /  H	        AP
AP2928142 /  J	        AP
The formula that I'm working with looks like this:
=LEFT(A2,3-ISNUMBER(MID(A2,2,1)+0))

This works only for the first 3 rows. Rows with only 2 alpha characters show up with a number - AP2 for example. Not sure how to adjust my formula to make it work correctly. Thanks for your help.
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Try eg:

=LEFT(A2,MATCH(TRUE,INDEX(ISNUMBER(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)+0),),FALSE)-1)
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,791
Hi

Another option:

=LEFT(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789"))-1)
 

meldoc

Well-known Member
Joined
Jul 18, 2009
Messages
1,249
Hello

Or this, another one of Andrew's modified slightly.

=SUBSTITUTE(A2,MID(A2,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},A2&1234567890)),100),"")
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,826
Messages
5,513,599
Members
408,963
Latest member
Joao Corvina

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top