+ Reply to Thread
Results 1 to 12 of 12

Split data between phone number and next name

  1. #1
    Registered User
    Join Date
    04-30-2021
    Location
    Victoria, Australia
    MS-Off Ver
    Microsoft 365
    Posts
    6

    Split data between phone number and next name

    I have some inconsistent phone number data which i need to split into separate columns. I cannot work out how to do it.

    Any ideas would be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,822

    Re: Split data between phone number and next name

    in the file you attached, are columns B and C what you want to see? So you want the name and the phone number in one cell? can you add what you expect to see for the other rows too (rows 2:5)?

  3. #3
    Registered User
    Join Date
    04-30-2021
    Location
    Victoria, Australia
    MS-Off Ver
    Microsoft 365
    Posts
    6

    Re: Split data between phone number and next name

    Hi Greg, Yes column B and C are what I want to see.
    The name and phone number can be in one or 2 cells but they need to be in the right order. I have tried the split number and character feature but it put all names in one column and all numbers in another.
    I will update the other rows as requested.
    Cheers
    Attached Files Attached Files
    Last edited by Leeta77; 05-03-2021 at 10:20 PM.

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,435

    Re: Split data between phone number and next name

    In B2:
    =IFERROR(LEFT(MID(SUBSTITUTE($A2," ",""),SEARCH(A9,SUBSTITUTE($A2," ",""))+LEN(A9),255),AGGREGATE(15,6,SEARCH(ROW($1:$10)-1,MID(SUBSTITUTE($A2," ",""),SEARCH(A9,SUBSTITUTE($A2," ",""))+LEN(A9),255)),1)+9),"")

    C2:
    =IF(B2="","",IFERROR(LEFT(MID(SUBSTITUTE($A2," ",""),SEARCH(B2,SUBSTITUTE($A2," ",""))+LEN(B2),255),AGGREGATE(15,6,SEARCH(ROW($1:$10)-1,MID(SUBSTITUTE($A2," ",""),SEARCH(B2,SUBSTITUTE($A2," ",""))+LEN(B2),255)),1)+9),""))
    drag C2 accross

    Drag all down
    Attached Files Attached Files
    Quang PT

  5. #5
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,822

    Re: Split data between phone number and next name

    ******EDIT - I did not see Bebo's response before I posted this. Looks like his formulas are much more efficient, as I figured they would be ***********

    I have no doubt that these formulas can be refined, but it's late and they work (as far as I can tell), but maybe you (or someone else here) can make them a little more efficient.

    In B2, enter this formula:
    Please Login or Register  to view this content.
    Then you can copy this down the column.

    In C2, enter this formula:
    Please Login or Register  to view this content.
    Copy this down and then copy it across.

    See attached.
    Attached Files Attached Files
    Last edited by Gregb11; 05-04-2021 at 12:19 AM. Reason: adding info

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Split data between phone number and next name

    Here is UDF code

    Please Login or Register  to view this content.
    UDF

    How to Use UDF code:
    In the developer tab click--> Visual Basic
    VB window opens
    Insert--> Module
    Paste the code.
    Close the VB window.
    Now UDF is available in Function List
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  7. #7
    Registered User
    Join Date
    04-30-2021
    Location
    Victoria, Australia
    MS-Off Ver
    Microsoft 365
    Posts
    6

    Re: Split data between phone number and next name

    Hi,

    Thanks for your reply

    I like the look of your result but i can't get it to work. How and where do i apply the function? I've added it in VB and it's showing on the list.

    Ive tried adding in to B2 and selecting A2 but no good. What do i enter when it ask for Ip and K? I've tried lots of options with no luck.
    Thanks!

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Split data between phone number and next name

    File should be saved as .xlsm (Macro enabled file).
    Pl see the file. Formula is in B2 then copied to other region.
    In Formula in B2
    A2 is the text and Columns function shows the number of the portion to be selected.
    I think it is clear. Any further clarifications welcome.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 05-05-2021 at 03:21 AM.

  9. #9
    Registered User
    Join Date
    04-30-2021
    Location
    Victoria, Australia
    MS-Off Ver
    Microsoft 365
    Posts
    6

    Re: Split data between phone number and next name

    Wonderful! Thank you, it's working now

  10. #10
    Registered User
    Join Date
    04-30-2021
    Location
    Victoria, Australia
    MS-Off Ver
    Microsoft 365
    Posts
    6

    Re: Split data between phone number and next name

    Thanks Greg!

  11. #11
    Registered User
    Join Date
    04-30-2021
    Location
    Victoria, Australia
    MS-Off Ver
    Microsoft 365
    Posts
    6

    Re: Split data between phone number and next name

    Thanks Bebo!

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Split data between phone number and next name

    Welcome. Thanks for feed back.

+ 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. AutoFilter phone number column while keeping phone number formatting
    By Daneyuleb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2021, 12:49 AM
  2. Split Phone Number column into 2 new columns Mobile + Landline
    By marko198 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2021, 05:39 PM
  3. [SOLVED] Phone number format - reference post (Formatting Textbox to type phone numbers only)
    By eddyrcabrera79 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2015, 05:35 PM
  4. [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
  5. to split the phone number and email id into two different columns....
    By deepikakct in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2008, 08:57 AM
  6. split the phone number and email id into two different columns....
    By deepikakct in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-08-2008, 12:06 AM
  7. Replies: 0
    Last Post: 11-08-2008, 12:04 AM

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