+ Reply to Thread
Results 1 to 13 of 13

retrieving one word

  1. #1
    Registered User
    Join Date
    04-29-2006
    Posts
    68

    retrieving one word

    In Excel I would like to know how can I get out one word from inside field by using the condition of the first letters in that word?

    Example
    Give me the word starting by RAJ from the below,
    FERNAS ,NAMAS (RAJHIA1L078002C5-2863) 21ST OLAYA

    Thanks

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    not sure exactly what bit you want, this can be adjusted to suit , with text in a1 put
    Please Login or Register  to view this content.
    in c1
    type raj (upper or lower in b1)

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    You could also use SEARCH, which is not case sensitive:

    =MID(A1, SEARCH(B1, A1), SEARCH(")", MID(A1, SEARCH(B1, A1), 255) ) - 1)

  4. #4
    Registered User
    Join Date
    04-29-2006
    Posts
    68
    martindwilson and shg
    I appreciate your support, but If the word at the beginning of the sentence or at the end (not in the middle)
    What do I do??

    Thanks
    Last edited by migdad; 08-18-2008 at 02:01 AM.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Would you provide examples, please?

  6. #6
    Registered User
    Join Date
    04-29-2006
    Posts
    68
    Dear shg,
    Thanks for you support
    Example #1
    Give me the word starting by RAJ from the below,
    RAJHIA1L078002C5-2863 21ST OLAYA FERNAS ,NAMAS

    Example #2
    Give me the word starting by RAJ from the below,
    OLAYA FERNAS ,NAMAS RAJHIA1L078002C5

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

    =MID(A1,SEARCH(B1,A1),SEARCH(" ",MID(A1&" ",SEARCH(B1,A1),255)))

    Where A1 contains original string and B1 contains string to search for.
    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.

  8. #8
    Registered User
    Join Date
    04-29-2006
    Posts
    68
    Quote Originally Posted by NBVC View Post
    Try:

    =MID(A1,SEARCH(B1,A1),SEARCH(" ",MID(A1&" ",SEARCH(B1,A1),255)))

    Where A1 contains original string and B1 contains string to search for.
    Thanks NBVC
    It is working with the word in the beginning of the sentence, but what about the word in the end of sentence??

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    It should also work with word at end of sentence...

    I tested it with your example#2 and got the expected result.

    Have you tried it? What error do you get?

  10. #10
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Just adding to NBVC example and looking at your very first example where its enclosed in brackets, you may need something like this

    Please Login or Register  to view this content.
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  11. #11
    Registered User
    Join Date
    04-29-2006
    Posts
    68
    Quote Originally Posted by NBVC View Post
    It should also work with word at end of sentence...

    I tested it with your example#2 and got the expected result.

    Have you tried it? What error do you get?
    Dear NBVC,
    sorry for confusing you
    It is working for both examples

    Thaaaaaaaaaaaaaanks

  12. #12
    Registered User
    Join Date
    04-29-2006
    Posts
    68
    Quote Originally Posted by oldchippy View Post
    Hi,

    Just adding to NBVC example and looking at your very first example where its enclosed in brackets, you may need something like this

    Please Login or Register  to view this content.

    Thanks a lot

  13. #13
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Sorry error in my last formula, but this will work with both brackets and non-brackets

    Please Login or Register  to view this content.

+ 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