+ Reply to Thread
Results 1 to 6 of 6

extracting surnames

  1. #1
    Forum Contributor
    Join Date
    02-18-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    356

    extracting surnames

    Hi Guys

    Ive been using this formula to extract football players surnames which works well
    =RIGHT(D2,LEN(D2)-FIND(" ",D2,1))

    However some of these pesky players only have a surname

    ie. Fred for man united
    or
    Jonny for wolves

    is it possible to manipulate the formula to suit this scenario to show Fred and Jonny as the surname despite not having a first name listed


    All help welcomed
    thanks in advance
    Last edited by swfarm; 03-02-2019 at 08:00 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: extracting surnames

    You really need to upload the data you're working with and add the results you expect to see. At the moment we can only guess what it looks like.

    One way might be to detect how many spaces there are in the string and slice it as necessary but we do need to see the data.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    02-18-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    356

    Re: extracting surnames

    hi Richard

    thanks for your reply
    it really is standard data
    ie

    Fred
    Wayne Rooney
    David Beckham
    Jonny
    Alan Shearer

    one space between first name and surname

    however as you can see there is no space before fred or after and the same with Jonny

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: extracting surnames

    Try
    =IFERROR(RIGHT(D2,LEN(D2)-FIND(" ",D2,1)),D2)

    or

    =TRIM(RIGHT(SUBSTITUTE(" "&D2," ",REPT(" ",50)),50))

  5. #5
    Forum Contributor
    Join Date
    02-18-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    356

    Re: extracting surnames

    perfection

    Thanks So much Phuocam
    much appreciated

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: extracting surnames

    ..another option

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

+ 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] Extracting Surnames from a list
    By [email protected] in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-08-2015, 10:26 AM
  2. Fixing Surnames with O/ Mc etc.
    By loughgill in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-08-2015, 08:30 PM
  3. Extracting data from file in directory and extracting filename
    By brad999 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2014, 11:21 AM
  4. Seperate First and Surnames
    By SpAnKy in forum Excel General
    Replies: 3
    Last Post: 06-20-2008, 12:33 PM
  5. I'm Trying To Isolate Capitalised Surnames From a String
    By Gordon@work in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2007, 02:35 AM
  6. [SOLVED] splitting first and surnames
    By mattguerilla in forum Excel General
    Replies: 2
    Last Post: 04-05-2006, 07:35 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