Solved

Pull phone numbers out of cell

Posted on 2014-07-25
3
155 Views
Last Modified: 2014-10-10
I have a column of data that has memo's in them. Short paragraphs are in each cell.

I would like to try to pull out any phone number listed in the memo in the next column. The phone numbers can be of any format ie: xxx.xxx.xxxx or (xxx) xxx-xxxx or xxxxxxxxxx.

If easier, I can write something for each format. For example pull out any phone number in the format (XXX) XXX-XXXX. Then another for any in the format XXX.XXX.XXXX. Then another for XXX-XXX-XXXX. Then one for XXX-XXX-XXXX.

Any way to make that happen? This could save me HOURS of time!
0
Comment
Question by:cansevin
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
Flyster earned 500 total points
Comment Utility
Will those be the only numbers in that string? If so you can try this:
=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)

Open in new window

This is an array formula so after you paste it, hit ctrl+shift+enter. Change "A1" to your target cell.
Flyster
0
 
LVL 27

Expert Comment

by:Glenn Ray
Comment Utility
^^^ That is one amazing function, Flyster.  The only possible issue is if other numbers exist, but I bet this will work for the questioner in almost all cases.
0
 
LVL 22

Expert Comment

by:Flyster
Comment Utility
@Glenn Ray. Thanks, but I really can't take credit for it. I came across it several years ago when I was looking to strip the numeric from a string. I only wish I would have documented where I got it from! You are correct. It will list all the numbers in that string.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now