+ Reply to Thread
Results 1 to 5 of 5

Search Value in Cell, Return Whole Word to Left or Right of Found Value

  1. #1
    Registered User
    Join Date
    04-21-2009
    Location
    Puyallup, WA
    MS-Off Ver
    Excel 2010
    Posts
    55

    Search Value in Cell, Return Whole Word to Left or Right of Found Value

    If I have the following phrase in cell A1:

    new home vinyl siding cost

    How do I find the whole words to the left or right of the word "siding" using a formula?

    Result of formula 1:
    vinyl siding

    Result of formula 2:
    siding cost

    I honestly don't understand FIND, SEARCH, functions well enough to provide an attempt at solving this. I think LEN would be involved here too?

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Search Value in Cell, Return Whole Word to Left or Right of Found Value

    Hi

    Give a try to these formulae.

    1)

    Please Login or Register  to view this content.
    2)

    Please Login or Register  to view this content.
    Change all the semi colons in my formula, to Comma, if you have to do this.

    Is this Ok, for you?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    04-21-2009
    Location
    Puyallup, WA
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Search Value in Cell, Return Whole Word to Left or Right of Found Value

    Thanks for your solution Fotis. It however was not quite suitable for what I'm trying to accomplish. Completely my fault for not being more clear in my question.

    I want to be able to define in the formula what value to look for in the cell referenced.

    For example, in the formula, I could edit it to find any value.

    Please Login or Register  to view this content.
    In this formula, I'd be able to edit it to look for different values like "windows" or "roofing" or "gutters" or "cars" or anything I wanted to find in the cell.

    Does that make sense?
    Last edited by sweetrevelation; 05-05-2012 at 02:35 PM. Reason: Put code around formula

  4. #4
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Search Value in Cell, Return Whole Word to Left or Right of Found Value

    An alternative, via User Defined Function (called "myWord")
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-21-2009
    Location
    Puyallup, WA
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Search Value in Cell, Return Whole Word to Left or Right of Found Value

    Thanks WHER. That's close to what I wanted. Still not quite exactly what I wanted since I have to cell reference another cell instead of actually writing the string I want within the formula. Is there not a way to do this without using a user-defined function and typing "string to lookup" somewhere within the formula?

    In any event, thanks for your effort and time. I'm very grateful and appreciative.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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