+ 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 XP to Office 2016
    Posts
    1,580

    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 2003, 2010, 2016 (Windows)
    Posts
    4,088

    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 XP to Office 2016
    Posts
    1,580

    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 2003, 2010, 2016 (Windows)
    Posts
    4,088

    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 XP to Office 2016
    Posts
    1,580

    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 2003, 2010, 2016 (Windows)
    Posts
    4,088

    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 XP to Office 2016
    Posts
    1,580

    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 2003, 2010, 2016 (Windows)
    Posts
    4,088

    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 XP to Office 2016
    Posts
    1,580

    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
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    23,676

    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!

    STOP PRESS: Forum Rules Updated September 2018! Please read them here.
    Are you new to Power Query and don't know what to do with the code you've been given? Have a look here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

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

    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
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    23,676

    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)

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