+ Reply to Thread
Results 1 to 9 of 9

complex search for words within a cell

  1. #1
    Registered User
    Join Date
    03-23-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Unhappy complex search for words within a cell

    i want to split a cell whilst also searching for a specific word.

    have a list of manufacturers and its code in the same cell eg.

    Company A.....A1234
    Company B....B5678
    etc

    What i want to do is search for a specific company and then return the two values in two columns.

    eg.

    Manufacturer Code
    Company A A1234

    Struggling!
    Last edited by dangey; 03-23-2010 at 09:31 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: complex search for words within a cell

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-23-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: complex search for words within a cell

    ok heres a dummy workbook

    what i want in this is to find "Ryan Air" and display its name in cell A11, the code in B11 and price in C11.

    the code is always 5 numbers preceded by a letter and is always at the end of the cell.
    Attached Files Attached Files

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: complex search for words within a cell

    It seems you have regular periods in there and a special Char(133) period... is that really so?

    If so,

    in A11: =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A3,CHAR(133),""),".",""),B11,"")

    in B11: =RIGHT(A3,6)

    in C11: =B3

    all copied down

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: complex search for words within a cell

    for code
    =RIGHT(A3,6)
    and assuming you always have some ...between (i must admit that's a strange 3 dot character)

    =REPLACE(A3,FIND("…",A3),255,"")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    03-23-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: complex search for words within a cell

    there is not set amount of periods in there, which is quite annoying

    is there any way i can search for the specific company or is it too complicated?

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: complex search for words within a cell

    My formula does not require a set amount of periods.. it replaces all of them whether regular "keyboard" period or special character (133) period... it replaces all of them.

    When you say search for specific company.. what do you mean?

    You want to manually enter a company name and then find the appropriate code and price?

  8. #8
    Registered User
    Join Date
    03-23-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: complex search for words within a cell

    it doesnt matter, think it will be simpler and less hassle to stick with what you've given me.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: complex search for words within a cell

    Both are doable...

    If you want to enter a company in A11, like Ryan Air... then in B11 use:

    =RIGHT(VLOOKUP(A11&"*",$A$3:$B$6,1,0),6)

    and in C11 use: =RIGHT(VLOOKUP(A11&"*",$A$3:$B$6,1,0),6)

    formulas can be copied down to get more as you input into column A the companies you want to extract data for...

+ 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