+ Reply to Thread
Results 1 to 9 of 9

Extract string from cell

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    9

    Extract string from cell

    Hello,

    I'm trying to extract the following value 'this is what I want to extract' from the below.

    m-1006621-cid:122244-kid:kwd-weweqe-KW:this is what i want to extract-e--04/08/2020 12:20:53
    m-1006621-cid:122244-kid:kwd-weweqe-KW:this is what i want to extract-b--04/08/2020 12:20:53

    I've used the following which works (using 2 formulas) but ideally want it in one:

    =IFERROR(MID(A1,FIND("KW:",A1)+3,LEN(A1)),"")
    =IFERROR(LEFT(A1,FIND("-",A1)-1),"")
    Attached Files Attached Files
    Last edited by ukguy; 08-05-2020 at 03:43 AM.

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

    Re: Extract string from cell

    Can you please add some more examples to see if all patterns are the same / different? ( see yellow banner)

  3. #3
    Registered User
    Join Date
    02-08-2012
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Extract string from cell

    Forgot to press upload. See attached!

    Is it possible to also extract the cid and kwd value as well.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Extract string from cell

    with text to column and used - as seperator.

    see the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Registered User
    Join Date
    02-08-2012
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Extract string from cell

    Thanks - really need this in a formula as the source data will be changing daily.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Extract string from cell

    Please try at A2

    =TRIM(LEFT(SUBSTITUTE(MID(D2,IFERROR(SEARCH("KW:",D2),8)+3,99),"-",REPT(" ",99)),99))

    or

    =TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D2,IFERROR(SEARCH("KW:",D2),8)+3,99),"+",),"--",),"-",REPT(" ",99)),99))
    Attached Files Attached Files
    Last edited by Bo_Ry; 08-05-2020 at 05:03 AM. Reason: Add 2nd formula

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Extract string from cell

    It is quite long, but it works without helper:

    Please Login or Register  to view this content.
    Last edited by bebo021999; 08-05-2020 at 04:45 AM.
    Quang PT

  8. #8
    Registered User
    Join Date
    02-08-2012
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Extract string from cell

    Thanks for your help.

    Unfortunately they didn't work.

    The following got close but didn't extract any strings that contained +this is a value I want to extract

    =TRIM(LEFT(SUBSTITUTE(MID(D2,IFERROR(SEARCH("KW:",D2),8)+3,99),"-",REPT(" ",99)),99))

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Extract string from cell

    @ukguy

    You got 3 possible answers to solve your problem.

    You tell us 1 doesn't work.

    What about the other 2 solutions?

+ 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] Extract the value of above cell which has a particular word string
    By Shareez Saleem in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-31-2016, 07:27 AM
  2. [SOLVED] Extract text from string in cell
    By VBA FTW in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-26-2013, 05:08 PM
  3. Replies: 3
    Last Post: 07-25-2012, 07:54 AM
  4. Extract Alphanumeric string from a cell
    By kenny.fsw in forum Excel General
    Replies: 1
    Last Post: 06-12-2012, 04:36 AM
  5. Extract string from a cell
    By scottt725 in forum Excel General
    Replies: 3
    Last Post: 04-10-2012, 10:37 PM
  6. Extract number from cell as string
    By Tey in forum Excel General
    Replies: 4
    Last Post: 04-22-2010, 03:30 AM
  7. Extract string from cell
    By greavesy in forum Excel General
    Replies: 14
    Last Post: 08-20-2009, 10:03 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