Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts

    find a text in a string

    hi all,

    say i have in column A1 a string & i wnat to search for specific strings and they are not in any specific order. for example:
    column A1
    mrk,wrl,fma,deen
    deen,mrk,wrl
    fma,mrk,deen,sol,wrl,deen,dod,waq
    wrl,dod,wqr,waq,sol,saf

    what i need is extarct only mrk&wrl&deen and have them in column"B"

    regards,
    Last edited by dubdub; 2012-07-20 at 02:04.
    TIA
    dubdub

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    You could use
    =trim(IF(ISNUMBER(SEARCH("mrk",A1)),"mrk ","")&IF(ISNUMBER(SEARCH("wrl",A1)),"wrl ","")&IF(ISNUMBER(SEARCH("deen",A1)),"deen ",""))
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts
    thanks Rory, it works, is there a possibility to have a space between the text in column B.

    Regards,
    TIA
    dubdub

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    That should put spaces between the words.
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts
    it does, thanks again.

    dubdub
    TIA
    dubdub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •