+ Reply to Thread
Results 1 to 7 of 7

Extracting text from cells

  1. #1
    Registered User
    Join Date
    05-17-2019
    Location
    Madison
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    13

    Smile Extracting text from cells

    Hi,

    I'm trying to develop some formulas for extracting text from other cells.

    The raw data that I receive ALWAYS comes in the following format:
    (last name) (add. last name [theoretically repeated as many as necessary]) (credentials), (first name) (middle name [theoretically repeated as many as necessary])

    I need help with two formulas: one for extracting a person's credentials, and one for extracting all last name(s). I'm kind of new at this, so sorry if the answer is obvious.

    1. Extracting the Credentials
    Need: formula that grabs the single word just before a comma.
    Current formula: =MID(LEFT(D2,FIND(",",D2)-1),FIND(" ",D2)+1,LEN(D2))
    Why it doesn't work: grabs part of a person's last name when multiple last names are given
    *Note: a persons credentials are only ever one word (ex. PhD, MD, etc.)

    2. Extracting the full last name
    Need: formula that grabs all words excluding the single word just before the comma.
    Current formula: =LEFT(D2,FIND(" ",D2)-1)
    Why it doesn't work: does not capture all last names

    I've created a dummy workbook so you all can see the problem for yourselves.

    Thanks so much!
    Attached Files Attached Files
    Last edited by Sprong; 05-29-2019 at 01:31 PM.

  2. #2
    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,987

    Re: Extracting text from cells

    The attachment is invalid - please try again.
    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.

  3. #3
    Registered User
    Join Date
    05-17-2019
    Location
    Madison
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    13

    Re: Extracting text from cells

    I tried uploading it again, is it working now?

  4. #4
    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,987

    Re: Extracting text from cells

    Yes, thanks - taking a look.

  5. #5
    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,987

    Re: Extracting text from cells

    Last name: =LEFT(SUBSTITUTE(D2,TRIM(RIGHT(SUBSTITUTE(LEFT(D2,FIND(",",D2)-1)," ",REPT(" ",99)),98)),""),FIND(",",SUBSTITUTE(D2,TRIM(RIGHT(SUBSTITUTE(LEFT(D2,FIND(",",D2)-1)," ",REPT(" ",99)),98)),""))-1)

    Title: =TRIM(RIGHT(SUBSTITUTE(LEFT(D2,FIND(",",D2)-1)," ",REPT(" ",99)),98))

  6. #6
    Registered User
    Join Date
    05-17-2019
    Location
    Madison
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    13

    Re: Extracting text from cells

    Awesome! Thanks so much.

  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,987

    Re: Extracting text from cells

    No worries.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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 Multiple Number Values from Text cells into separate cells
    By skydoc in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-14-2016, 10:14 AM
  2. Extracting certain text from cells
    By ajbettencourt in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-29-2013, 11:59 AM
  3. Extracting text from cells
    By applesandpears in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-21-2012, 08:40 PM
  4. Extracting Text from Cells
    By choke in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-05-2012, 12:18 PM
  5. Extracting text from cells
    By malnahar in forum Excel General
    Replies: 5
    Last Post: 10-29-2010, 11:15 AM
  6. Extracting #s from cells with text.
    By kevsvette in forum Excel General
    Replies: 7
    Last Post: 11-05-2009, 04:40 PM
  7. extracting text from cells
    By famdamly in forum Excel General
    Replies: 11
    Last Post: 02-26-2006, 08:19 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