Extract numbers from strings formula in excel

Posted on 2010-09-20
Last Modified: 2012-05-10
Hi Experts:

Let's say I have a field with the string value = ABC 12345123451
I need to extract the number out of that field, just the 11-number and leave the text.
What is the solution for this with formula not VBA?
Question by:luisr69
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
LVL 24

Expert Comment

ID: 33717322
Try this, enter it with Ctrl+Shift+Enter so curly brackets appear round it

LVL 50

Expert Comment

by:barry houdini
ID: 33717365
It depends on the consistency of your data. If there are always 11 digits at the end try
If that isn't the case then please post some representative examples
regards, barry

Author Comment

ID: 33717442
It returns the first 5-number:12345 without texts.
Why is "1*MID" if you don't mind my asking.
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.


Author Comment

ID: 33717514
Yes it will always be 11-digit.
LVL 24

Accepted Solution

StephenJR earned 250 total points
ID: 33717540
Sorry, this is an alternative, but if always the same format barry's approach looks simpler.

LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 200 total points
ID: 33717545
Does that work for you then? If there are any leading zeroes then my suggested formula will lose them (because +0 converts to numeric). If you want to retain leading zeroes use just
The result will be a text-formatted number
regards, barry

Assisted Solution

by:Rodney Endriga
Rodney Endriga earned 50 total points
ID: 33717569
If your data is standardized, then you can use the following:
This will pull all the information from the Right side of the cell that is 11-characters long.

If it is not standardized, you can use something like:
=RIGHT(A1,LEN(A1)-FIND(" ",A1,1))
This will grab everything to the Right side of the " " (space character). No matter what the length of the numbers. You can replace the space character in the formula to another character, if needed (i.e. ~, |, .)

For both cases, you just need to reference the proper cell. Change the A1 to wherever your data is located.
LVL 12

Expert Comment

ID: 33717574
And if the data is v.consistent and of the form
<string> <space> <number>

Then u can select that column and then go to Data >> Text to Columns >> Delimited >> Use "Space" as the separator.


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question