+ Reply to Thread
Results 1 to 10 of 10

Searching if a cell contains a range of values

  1. #1
    Registered User
    Join Date
    07-03-2014
    Location
    Australia
    MS-Off Ver
    Mac
    Posts
    4

    Searching if a cell contains a range of values

    Hi All,

    So I use this formula to check if a cell contains a specified piece of text in the case it is "SP" and the return a result

    IF(ISNUMBER(SEARCH("sp",A1)),"EBC", "ONLINE")

    What I need to do now is check to see is a cell contains a value that is in a range of values.


    For example.

    in A1 I would have the value xyz.com

    In my range of have thousands of values ) one of which is xyz (not xyz.com) and returns a positive or negative result

    How do I create a formula that

    Cheers

    LUke

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

    Re: Searching if a cell contains a range of values

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    "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

  3. #3
    Registered User
    Join Date
    07-03-2014
    Location
    Australia
    MS-Off Ver
    Mac
    Posts
    4

    Re: Searching if a cell contains a range of values

    Thanks

    The named range id called "gtld"example.xlsx

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

    Re: Searching if a cell contains a range of values

    try in B2 of sheet2 filled down something like,change true/false results as you need
    =IF(ISNUMBER(LOOKUP(10^99,SEARCH(gtld,A2))),"found","not found")

  5. #5
    Registered User
    Join Date
    07-03-2014
    Location
    Australia
    MS-Off Ver
    Mac
    Posts
    4

    Re: Searching if a cell contains a range of values

    OMG you are a legend thank you

  6. #6
    Registered User
    Join Date
    07-03-2014
    Location
    Australia
    MS-Off Ver
    Mac
    Posts
    4

    Re: Searching if a cell contains a range of values

    Sorry one more question. What if I wanted to return a result from found result in that range?

  7. #7
    Registered User
    Join Date
    05-08-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    7

    Re: Searching if a cell contains a range of values

    Quote Originally Posted by martindwilson View Post
    try in B2 of sheet2 filled down something like,change true/false results as you need
    =IF(ISNUMBER(LOOKUP(10^99,SEARCH(gtld,A2))),"found","not found")
    This is an excellent method! I've been trying to figure out the best way to do this, as well.
    Would you know how to apply this to a search through two columns of data? Essentially, using the same range of data to check against two columns, instead of one.

    I've tried inserting the OR function, but I keep getting a "too many arguments" error. I've even tried parsing the ISNUMBER(LOOKUP(... section from named cells on my Table sheet. No luck, so far.

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

    Re: Searching if a cell contains a range of values

    Psyphon welcome to the forum but>>>>>>>
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

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

    Re: Searching if a cell contains a range of values

    ah i forgot a bit ,that formula would say found if it found the x in xaa ,trouble is search will find anything in the string that matches so loads of partial matches may be found
    to limit it you can sort the data to be looked up by length ,smallest to largest then the longest match will be returned
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-08-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    7

    Cool Re: Searching if a cell contains a range of values

    Mea culpa!

    I'll post a separate thread.

    Cheers!

+ 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. Replies: 19
    Last Post: 04-15-2014, 09:41 AM
  2. Searching for values within a range
    By jakeamus in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-31-2013, 12:31 PM
  3. Searching a range of values for outliers
    By kurifodo in forum Excel General
    Replies: 4
    Last Post: 05-22-2011, 06:20 PM
  4. Searching for values within a string across a range of cells
    By futureboy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2010, 07:53 PM
  5. VBA -searching using range of values
    By ACOM in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2009, 02:36 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