+ Reply to Thread
Results 1 to 6 of 6

extract text strings

  1. #1
    Forum Contributor
    Join Date
    09-21-2007
    Posts
    196

    extract text strings

    Can anyone help. I want extract the first name and surname from a text string containing their full name.

    e.g. HAWES:GEORGE RICHARD becomes HAWES:GEORGE

    Obviously they are all different lengths of name

    Many thanks

    Jack

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =LEFT(A1,FIND(" ",A1))
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Or may be

    =TRIM(LEFT(A1,FIND(" ",A1)))

    or

    =LEFT(A1,FIND(" ",A1)-1)
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Or
    Data - Text to columns - use space as delimiter

  5. #5
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256
    I usually prefer the menu: Data, Text to columns

    Here are a few options, as building blocks:
    Family name: =LEFT(A1,FIND(":",A1)-1) --> HAWES
    First name: =LEFT(MID(A1,FIND(":",A1)+1,255),FIND(" ",MID(A1,FIND(":",A1)+1,255))-1) --> GEORGE
    Second name: =MID(A1,FIND(" ",A1)+1,255) --> RICHARD

    The formulas work for the sample, but will probably not work for all instances, since names are very inconsistant in their layout. I.e. Mr, Andersson-Smith, ...
    //Ola

  6. #6
    Registered User
    Join Date
    08-13-2008
    Location
    doughboy
    Posts
    9
    if you want to learn how to this also yourself in case you want to change the formulas later on I would suggest a good resource to check out here:

    http://www.teachexcel.com/tutorials/...raction_p1.php
    http://www.teachexcel.com/tutorials/...s/formulas.php

+ 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. Making all text strings the same length
    By rs56369 in forum Excel General
    Replies: 3
    Last Post: 11-12-2014, 07:45 AM
  2. Find row number of text string in a range of cells
    By Steven Fleck in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-06-2013, 08:38 PM
  3. extracting text strings from a cell
    By penfold in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-27-2008, 06:41 AM
  4. Extracting strings of text from Columns of data(text)
    By welshmagic69 in forum Excel General
    Replies: 9
    Last Post: 04-23-2007, 02:50 PM
  5. Leading Quote in Text Strings
    By nsv in forum Excel General
    Replies: 7
    Last Post: 03-20-2007, 11:18 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