+ Reply to Thread
Results 1 to 11 of 11

separate Name into two columns

  1. #1
    Registered User
    Join Date
    11-19-2007
    Posts
    85

    separate Name into two columns

    Hello all,

    I am wondering if anyone know if there is a formula that can separate a name which sometimes have two words or one or two space. For example a formula that can separate a name by first space in one column and the second half in the second column.

    example : David T Blain

    name is in column A,

    column B is David T
    column C is Blain.

    I don't think this is possible with a formula, but if you think it is let me know.

    I think it would be more efficient to do this with a macro, could you please see if you could provide a macro that can do this.

    Thanks
    Last edited by JohnSeito; 10-15-2008 at 07:47 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    If your data is in A1 then try:
    B1:
    Please Login or Register  to view this content.
    C1:
    Please Login or Register  to view this content.
    HTH

    rylo

  3. #3
    Registered User
    Join Date
    11-19-2007
    Posts
    85
    Ok thanks. Do you know if these formula works in visual basics? I would like to have the option of using it either as formula or formula in visual basics. thanks.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    You could either used EVALUATE on the formulas, or something like
    Please Login or Register  to view this content.
    rylo

  5. #5
    Registered User
    Join Date
    11-19-2007
    Posts
    85
    I am not sure what you mean by EVALUATE on the formula.

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    If "David T Blain" goes to "David T" - "Blaine"
    , does "Leonardo da Vinci" go to "Leonardo da" - "Vinci"

    Parsing FullName to First/Last by spaces is un-reliable. These functions might help, they default to splitting at the last space, but which space to split at can be specified for unusual names.

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello JohnSeito,

    This macro is a UDF (User Defined Formula). You can use this like a worksheet formula. Place the UDF macro code in a standard VBA module. You can then use it on the worksheet like a formula. See the examples.

    Examples
    Please Login or Register  to view this content.
    UDF Macro Code
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  8. #8
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    EVALUATE is a VBA function that will take a formula string, evaluate it, and provide the result of the evaluation. So something like

    Please Login or Register  to view this content.
    would put the result of the sum of A1:A3 into the variable xxx. You could do the same sort of thing with the functions used in Excel to provide the result.


    rylo

  9. #9
    Registered User
    Join Date
    11-19-2007
    Posts
    85
    Thank you. I will take a look at your codes and try them out. If I have any questions I will let you know.

  10. #10
    Registered User
    Join Date
    11-19-2007
    Posts
    85
    Solved, thanks. I have checked it.

  11. #11
    Registered User
    Join Date
    01-05-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: separate Name into two columns

    Simple way..

    select the column which you want to split in to two parts..

    Go to DATA option..

    Select TEXT TO COLUMNS..

    Choose DELIMINATED..

    TAB SPACE ( choose the option by which name is separated)

    Go to NEXT.. and Finish..

    But before doing this.. add the same number of columns in against the present column in which name is present.
    ( example : If name have three parts. Initial, first name and last name.. so add 2 columns after the column in which full name is present.

+ 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. separate different data from one column another columns
    By standa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-11-2008, 03:15 AM
  2. Moving data from 2 rows to 3 separate columns
    By sandra08 in forum Excel General
    Replies: 1
    Last Post: 04-01-2008, 04:50 PM
  3. How to separate text cell into columns
    By ExcelNewby in forum Excel General
    Replies: 7
    Last Post: 11-06-2007, 07:46 AM
  4. [SOLVED] Separate data into columns based on the value of one column?
    By dziw in forum Excel General
    Replies: 4
    Last Post: 10-11-2007, 01:58 PM
  5. separate content in cell into different columns
    By flygarenbob in forum Excel General
    Replies: 4
    Last Post: 01-14-2007, 11:29 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