1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Excel: Extract text from the middle of a text string - Difficult

Discussion in 'Business Applications' started by Blinken86, Apr 29, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. Blinken86

    Blinken86 Thread Starter

    Joined:
    Mar 25, 2008
    Messages:
    9
    Afternoon,

    I'm having trouble extracting text from the middle of a text string using Excel.

    I've been searching around and there are a few ways this can be done however most really on using a function to search for the text after a specific letter or seperator.
    For example singling out the middle initial of a name:

    Jeffery J. Skilling
    John D Doe

    In Column B the First Name will be extracted using the following formula
    =LEFT(A2,SEARCH(" ",A2,1)-1)

    in Column C the Middle Initial will be extracted. for middle init use this formula
    MID(A2,SEARCH(" ",A2,1)+1,1)


    My problem is that i can't single out anything to search by to be able to define what needs to be extracted.

    Below is a list containing some of the items from my list. As you can see they differ in number of characters and have multiple dashes "-". What formula/process can i use to extract the bold numbers from each of the text strings. I have about 27000 lines to process!

    200-CP-57535-B
    150-CL-3871-S
    200-DMW-57135-B3
    250-CL-57133-B3
    80-SW-18363-X1
    80-DO-57101-B

    Once again your help is always greatly appreciated!(y):)
     
  2. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    "multiple dashes": agreed, but in your sample all items have the same number of multiple dashes -- 3.

    If that's a given, just use Data > Text to Columns with "-" as delimiter. Then delete fields 1, 2 & 4 from the results since it seems that "section" 3 is always the bold stuff.

    HTH, if not post back.
     
  3. Blinken86

    Blinken86 Thread Starter

    Joined:
    Mar 25, 2008
    Messages:
    9
    Talk about being stuck with your blinders on!
    Ameteaur mistake on my behalf... Sometimes we overlook the simplest means in the pursuit of the complicated. I knew i was forgetting something simple...

    Greatly appreciated mate! Maybe now the stress levels are turned down a bit i can start thinking straight again.
     
  4. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    "Greatly appreciated mate!"

    "Mate"? Are you Australian or something? :confused:

    :D ;)

    Thanks for marking this Solved. (y) :)
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/822744

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice