+ Reply to Thread
Results 1 to 8 of 8

Excel Formula needed: Find Phone Number(s) in a string

  1. #1
    Registered User
    Join Date
    02-11-2021
    Location
    New Zealand
    MS-Off Ver
    2016
    Posts
    17

    Excel Formula needed: Find Phone Number(s) in a string

    Good afternoon all,

    I have a problem that I am sure this amazing community will solve (almost immediately no doubt). I would love to have a formula to do this all. I really don't want to have to convert text to columns if possible.

    For this example,

    In the first column I have a variable text string. In some cells there is no phone number, in other cells there is 1 phone number and in other cells there are 2 phone numbers. (There are never more than 2 phone numbers)
    In the second column I would like to return the first phone number if present however phone number suffix not required (ie do not return "+12")
    In the third column I would like to return the second phone number if present (also not returning the "+12"). Blank if not present.
    The original and preferred outcome is below:

    Original:
    Phone Problem.jpg

    Outcome:
    Phone Solution.jpg



    Session DNIS

    tel:+1234567891; tel:+1234567892
    tel:+1234567893
    tel:+1234567894; sip:randomstring;morerandomstrings;evenmorerandomstring; tel:+1234567895



    I hope this makes sense. Please reach out if you have any questions!

    Thanks for your time
    Last edited by Brisbanejez; 03-28-2024 at 02:01 AM.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: Excel Formula needed: Find Phone Number(s) in a string

    Maybe like this, consider your data on A1, put this on B1

    =TEXT(TEXTSPLIT(A1,"+"),"#######")

  3. #3
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,428

    Re: Excel Formula needed: Find Phone Number(s) in a string

    If your Excel is updated to Excel 365 in the meantime:

    First number: Please try and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Second number: Please try and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Excel Formula needed: Find Phone Number(s) in a string

    If you do not upgrade from Excel 2016 then..

    First column
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Second column
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-11-2021
    Location
    New Zealand
    MS-Off Ver
    2016
    Posts
    17

    Re: Excel Formula needed: Find Phone Number(s) in a string

    @DJunqueira Thank you so much for this. I noticed with large volumes of data it takes quite some time to calculate (it essentially adds 15mb to the xlms file).

    In any case, this solution worked. Thanks!!

  6. #6
    Registered User
    Join Date
    02-11-2021
    Location
    New Zealand
    MS-Off Ver
    2016
    Posts
    17

    Re: Excel Formula needed: Find Phone Number(s) in a string

    @HansDouwe Thank you for your time with this. This works perfectly and is the exact formula I was after.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Excel Formula needed: Find Phone Number(s) in a string

    Administrative Note

    Please don't ignore contributors to your thread - it takes members time to provide suggestions, so acknowledge all solutions offered, even if they don't meet your requirements. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,428

    Re: Excel Formula needed: Find Phone Number(s) in a string

    You are Welcome!

    Thanks for the feedback and rep .

    Glad to have helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Remove Phone Number From String
    By cjamps in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-04-2020, 08:52 AM
  2. Remove phone number in cells that contains string and number
    By farisnaufghas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2018, 07:49 PM
  3. Detect and remove phone number in cells that contains string and number
    By farisnaufghas in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2018, 05:34 PM
  4. [SOLVED] Excel formula needed to find string and then copy details from another cell
    By jopat in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-09-2014, 10:10 PM
  5. [SOLVED] Macro needed to split email and phone number
    By Smally in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-20-2013, 06:33 AM
  6. Is it possible to make Excel dial a phone number from my smart phone?
    By D_Step in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-19-2013, 06:11 PM
  7. custom phone number format help needed
    By jcat3az in forum Excel General
    Replies: 1
    Last Post: 09-27-2011, 08:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1