Solved

I need an excel formula or macro for extracting one string of numbers that resides between  parenthesis

Posted on 2015-01-23
7
129 Views
Last Modified: 2015-01-23
I have a column of names with corresponding id numbers - I need to extract only the numbers from this column..  

example

Smith, Jane (2342)
Litton, Keely (9890)
Huffman, Rosemary (98999)
Easterling, William (1234557)

Data is in column B and I want them to appear on the same worksheet in column A, right next to the name, on the same row).
What formula should I use, or is there a macro for stripping these  numbers out in one easy step?
0
Comment
Question by:klitton7
[X]
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
  • +1
7 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40566414
=VALUE(MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1))
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40566416
Assuming it is in A1.
0
 

Author Comment

by:klitton7
ID: 40566426
Perfect!  Thanks Phillip
0
Independent Software Vendors: 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!

 
LVL 33

Expert Comment

by:Rob Henson
ID: 40566431
You could also use the Text to Column function to split the values across two columns.

The result will still have the closing bracket after the number but a Find and Replace can soon get rid of those. The result will also then be a text value but I guess as its a Personnel ID you wouldn't need to be doing any mathematical functions on it. If then used in subsequent lookups and such like, the lookup function will have to allow for the ID being text.

Thanks
Rob H
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40566435
here is another version, in case if sometimes your numbers are not within parenthesis

=SUM(MID(0&A1,LARGE(ISNUMBER(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))*ROW(INDIRECT("1:"&LEN(A1))),ROW(INDIRECT("1:"&LEN(A1))))+1,1)*10^ROW(INDIRECT("1:"&LEN(A1)))/10)

press with Control Shift Enter
0
 

Author Comment

by:klitton7
ID: 40566532
Rob - thanks for your comment.  I had been using that process, but found it too cumbersome.

Also Thanks also to Professorlimlam...  in this particular instance, the numbers are always inside parenthesis, but I will hold on to this formula for future reference.  

Many thanks!
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40566603
Using just the one formula above will only split the numbers into a separate cell; result being name with number in one cell and just number in adjacent cell.

If you want to split the values into two, ie name in one cell and number in another, you will need an additional formula for that. The results can then be copied and pasted as values.

To split out just the name:

=TRIM(LEFT(B2,FIND("(",B2,1)))

Thanks,
Rob H
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

739 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