+ Reply to Thread
Results 1 to 4 of 4

Extract multiple values from long strings of text

  1. #1
    Registered User
    Join Date
    10-03-2012
    Location
    Highland Heights, Ky
    MS-Off Ver
    Excel 2010
    Posts
    3

    Extract multiple values from long strings of text

    Hello,

    I am trying find specific strings in long strings of text contained in various rows. I tried writing a formula to do this but received a #Value! error. Below is an example of what I am trying to accomplish and the equation I used

    Trying to extract the values (4/0, #6, 350, 1000) and put them into Column 2

    Column A------------------------------------Column B
    4/0-19w H19 1350 Comp----------------------4/0
    #6-7w H16 1350 Cmpt------------------------#6
    350 kcmil 37w H221 8177 Conc---------------300
    1000 kcmil 61w H19 Unilay Comp------------1000

    I have used the following code but I could not get it to work. I will read the very first value in the code (4/0) but when I drag the formula down. It will only give me the values that are 4/0 and none of the other ones

    =IF(SEARCH("4/0",A1),"#4/0",IF(SEARCH("#6",A1),"#6",IF(SEARCH("300",A1),"300",IF(SEARCH("1000",A1"),"1000")))))

    Can I use a formula like this to achieve this result? Or do I have to write a macro?

    Thanks,
    Patrick

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Extract multiple values from long strings of text

    not clear obviously you did not give complete information
    why not just type this formula in an empty cell

    ="4/0"&"#6"$350$1000
    I am not an expert. better solutions may be available
    [email protected]

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Extract multiple values from long strings of text

    One way :Select your column
    Ctrl + H
    replace what -
    replace with (space)
    OK
    Then Data - text to columns - delimited - Next -Select " space" - Next - Select " do not import" for each column except first - OK

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Extract multiple values from long strings of text

    Is it

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

    ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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