+ Reply to Thread
Results 1 to 12 of 12

Syntax for File search with multiple criteria

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Syntax for File search with multiple criteria

    Hi,

    In a specific directory I want to Search files with this criteria
    Type should be = ".xlsm"
    Name should be like "Send Emails*"or "Collect Data*" or "Create Company*"
    Tags should be = "Completed" or "Task Issue"
    ModifiedDate should be from today to last 7 days


    And the search should not list the deleted files as shown in the screenshot
    What syntax should I type in the top right search bar?

    Help would be greatly appreciated

    Imran Bhatti
    Attached Images Attached Images
    Teach me Excel VBA

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,910

    Re: Syntax for File search with multiple criteria

    Try

    ext:.xlsm +("Send Emails" OR "or "Collect Data" OR "Create Company") Tags: (Completed OR Task Issue) Modified:this week -deleted
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Syntax for File search with multiple criteria

    "No item match your search"
    While I have matching items

    Sorry for not mentioning the Windows version

    Its Windows 8.1 64 bit
    Last edited by ImranBhatti; 10-23-2018 at 02:35 AM.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,910

    Re: Syntax for File search with multiple criteria

    Try the string part by part and see if the parts work by themselves (and make sure that your OR filters are capitalized):



    ext:.xlsm

    Then

    +("Send Emails" OR "or "Collect Data" OR "Create Company")

    Then

    Tags: (Completed OR Task Issue)

    Then

    Modified:this week

    Then

    -deleted

  5. #5
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Syntax for File search with multiple criteria

    This is not working
    +("Send Emails" OR "or "Collect Data" OR "Create Company")
    (not working separatly and combined with other criterias
    other criteria are working if used separately.

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,910

    Re: Syntax for File search with multiple criteria

    Sorry - use it without the quotes

  7. #7
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Syntax for File search with multiple criteria

    Yes by removing quotes worked. thanks

    But how can I combine them all as they are still not working as a one query.

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,910

    Re: Syntax for File search with multiple criteria

    Make sure that each of the sub queries returns at least one file that is the same for all the queries - otherwise, your combined query will not return any files.

    Also, I was wrong about the quotes - needed if there is a space in any string

    ext:.xlsm ("Send Emails" OR "Collect Data" OR "Create Company") Tags: (Completed OR "Task Issue") Modified:this week -deleted

  9. #9
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Syntax for File search with multiple criteria

    It needs to be played with for some time. I have at least found that there are minimum 2 files for each individual criteria. Some combinations of all the parts work and some don't. But as a whole your syntax is working and fulfilling my need to a greater extent.

    Thanks once again for your precious time and help

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,331

    Re: Syntax for File search with multiple criteria

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  11. #11
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Syntax for File search with multiple criteria

    Thanks Ali

    I want to keep this thread opened for some more time if it is not against any rule.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,331

    Re: Syntax for File search with multiple criteria

    If you wish.

+ 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. [SOLVED] If/IsNumber multiple search criteria. Does syntax accept "OR"?
    By onemoremile in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-03-2018, 05:36 PM
  2. Create User form to perform search using multiple search criteria
    By cherias in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-29-2015, 06:16 AM
  3. Create a search userform to search using multiple criteria
    By Aleemaher in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2014, 09:17 AM
  4. Replies: 4
    Last Post: 05-20-2014, 10:03 AM
  5. Search Multiple Worksheets Against List of Non-Exact Search Criteria?
    By thump4r in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2010, 03:46 PM
  6. [SOLVED] Syntax for IF with multiple criteria
    By SueJB in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-20-2005, 02:47 PM
  7. How do I search excel spreadsheets using multiple search criteria.
    By Kasper in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-14-2005, 08:30 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