Extract text to the right of a variable string?

Bryanf939

New Member
Joined
Dec 3, 2018
Messages
1
Hello everyone!

I use this forum extensively to get me through my Excel problems, but I haven't yet been able to find a solution for the following problem.

I have a bunch of text in column A1

FCL289AJDA
FCL3LASD
PEL383LLD

I am trying to extract the first part of the text and subsequent numbers only. I do not want the second part of the text to be outputted.

So for the above the output should be
FCL289
FCL3
PEL383

How can I do this in Excel? I tried using LEFT, RIGHT, FIND formulas, but I was never able to solve the issue if the length of the string differed.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hello,

You can test following array formula:

Code:
=LEFT(A2,MAX(IFERROR(FIND({1,2,3,4,5,6,7,8,9,0},A2,ROW(INDIRECT("1:"&LEN(A2)))),0)))

Hope this will help
 
Upvote 0
Here is an array-entered** formula that should work...

=LEFT(A1,MAX(IF(ISNUMBER(-MID(A1,ROW(INDIRECT("1:"&LEN(A1)-1)),1)),ROW(INDIRECT("1:"&LEN(A1)-1)))))

**Commit this formula using CTRL+SHIFT+ENTER and not Enter by itself
 
Upvote 0
Another array formula**:

=LEFT(A2,MATCH(1,1/MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)))

Regards
 
Upvote 0
Hello,

You can test following array formula:

Code:
=LEFT(A2,MAX(IFERROR(FIND({1,2,3,4,5,6,7,8,9,0},A2,ROW(INDIRECT("1:"&LEN(A2)))),0)))

Hope this will help

James,

Your formula fail for ABC1221CDSE
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,930
Members
449,094
Latest member
teemeren

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