+ Reply to Thread
Results 1 to 5 of 5

Searching for more than One piece of text

Hybrid View

  1. #1
    Registered User
    Join Date
    09-05-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    71

    Searching for more than One piece of text

    I have a catalog of reports that I want to search in, the list is thousands of rows long, the titles of the reports are one long text string in a column, I want to find all reports where "50" is in the title of the report and "engineering" is also in the title of the report ... is there a way to do this?? Looking at FIND function options doesn't appear to be a way ...

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Searching for more than One piece of text

    Hi

    I'd use an = IF(ISERROR(MATCH("*50*,A:A,False),"Not Found") in one column adjacent to your strings, and =ISERROR(MATCH("*engineering*",A:A,False),"Not Found") in in another.

    Copy these down and then filter the columns for values that don't have Not Found.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    09-05-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Searching for more than One piece of text

    error.png

    I get some kind of error message trying to copy in your first formula, notice how it's highlighting "Not

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Searching for more than One piece of text

    Not what you asked for but a macro like this could do it:

    Option Explicit
    
    Sub FindStr()
    Dim cell As Range
    
    For Each cell In Range("B1:B15")
    
    If InStr(cell, "50") > 0 And InStr(cell, "engineering") > 0 Then
        cell.Offset(0, 1).Value = "Match"
    End If
    
    Next
    
    End Sub
    Or perhaps somebody with more know how than me could write this as an UDF?

    By the way the command InStr is case sensetive so a combination of "Engineering" and "50" will not be taken as a match.

    Alf
    Last edited by Alf; 01-09-2015 at 04:43 PM. Reason: additional information

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Searching for more than One piece of text

    These could work for you. This has the titles in column A starting at A2 use this in column B (or column of your choice) and fill down:
    Formula: copy to clipboard
    =IFERROR(IF(AND(SEARCH("*50*",A2),SEARCH("*engineering*",A2)),"Found"),"")


    If you want to be able to enter different terms in say cells D1 and E1 use this in column B (or column of your choice) and fill down:

    Formula: copy to clipboard
    =IFERROR(IF(AND(SEARCH("*"&$D$1&"*",A2),SEARCH("*"&$E$1&"*",A2)),"Found"),"")
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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. How to display output from one locked data piece and one client-input data piece?
    By tnovak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2014, 12:48 PM
  2. Replies: 4
    Last Post: 08-13-2014, 11:03 PM
  3. Piece together a formulae with text
    By TuboDieselOne in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-09-2014, 05:41 PM
  4. Replies: 2
    Last Post: 05-08-2014, 11:33 AM
  5. Searching if a cell contains a specific piece of text in an IF/OR formula
    By jshaw82 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-23-2013, 02:52 AM

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