Excel formula to pull specific data from a string

Hi,

I have the following formula which looks for a specific string and then pulls data found to the right of the found string:

=MID(A1,FIND("ABC",A1)+3,LEN(A1))

The number which follows ABC is 6 numbers long and may have a space or not (ABC 000000 or ABC000000) .

Is it possible to to only return the 6 or 7 numbers after the ABC prefix and nothing else?

Thanks
LVL 1
anthonytrAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gowflowCommented:
yes
=TRIM(MID(A1,FIND("ABC",A1)+3,LEN(A1)))

gowflow
anthonytrAuthor Commented:
Hi gowflow,

I still can't trim the characters after the ABC 000000 numbers.  See below:

1788 / 33000 / MCS 170315 PC NQ / ABC 327996
Mr John Smith
An Address
Another Address
Somewhere
Earth

I just want to pull the ABC 327996 out.
gowflowCommented:
sorry can you post a sample workbook its not clear as there are carriage returns and is what you posted all in 1 cell ?
gowflow
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

gowflowCommented:
Let me rephrase:

You have all this in A1
1788 / 33000 / MCS 170315 PC NQ / ABC 327996
 Mr John Smith
 An Address
 Another Address
 Somewhere
 Earth


and need to get this:
 Mr John Smith
 An Address
 Another Address
 Somewhere
 Earth

Is that what you want ?
gowflow
anthonytrAuthor Commented:
Sort of,

I have all this in A1:

1788 / 33000 / MCS 170315 PC NQ / ABC 327996
 Mr John Smith
 An Address
 Another Address
 Somewhere
 Earth

and need to get this:

ABC 327996
gowflowCommented:
ok try this
=MID(A1,FIND("ABC",A1),SEARCH(" ",A1,FIND("ABC",A1)+4)-FIND("ABC",A1)-1)

gowflow
Rgonzo1971Commented:
Hi,

pls try

=MID(A1,FIND("ABC",A1),FIND(CHAR(10),A1)-FIND("ABC",A1))

Regards

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.