Boolean search with multiple criteria in Outlook (AND and OR statements)

For the longest time, I’ve been using Advanced Find and enabled its Query Builder to perform searches with multiple criteria and Boolean statements.

This worked quite well but I found out that Microsoft is removing Advanced Find from future Outlook 2016 releases.

How am I supposed to perform Boolean and multi criteria searches in Outlook now?

AND/OR Search Query buttonThe Advanced Find dialog indeed provided a nice WYSIWYG interface to build more complex search queries with relative ease.

What remains is the Search field at the top of your message list and although this might look quite Spartan at first, it’s actually quite powerful when you know the correct search query syntax and field names.

While performing a search query based on a partial string or with special characters isn’t possible in the Search field, performing a Boolean search with multiple criteria is possible.

Advanced Find dialog
Goodbye Advanced Find! You’ve been a good friend and a necessary evil for the past 2 decades to me. I hope all your features will get a proper replacement soon!

Search query example

Search Outlook buttonHow to perform a Boolean search with multiple search criteria might be best explained with an example.

In this example, we’re going to search our entire mailbox for emails that have an invoice attached to them but are not from Amazon. The envisioned query in words is as follows;

  • The word “invoice” in either the subject OR the body,
  • AND
  • Has an attachment,
  • AND
  • NOT be from Amazon,
  • AND
  • Should search all mail folders.

The actual search for this example query is;

(subject:invoice OR body:invoice) AND hasattachments:yes NOT from:Amazon

In addition, you’d set the Search Scope to Current Mailbox. This can be done via the dropdown list next to the Search field or the Scope group on the Search.

Boolean Search Query
In Outlook’s Search field, you can also perform a Boolean search.

Breaking down the example

How? buttonSo how does this query work?

First of all, we are directly targeting the fields that we want to query. Some of them are quite straightforward like “subject”, “body” and “from” while others can be inserted via the Refine group on the Search tab or by looking them up in this reference guide.

By using brackets, we can isolate the OR query and basically join the results for the Subject and Body fields.

With the AND statement, we are looking in these joined results and only select those which contain attachments.

With the NOT statement, we are filtering the results even further and discard the emails that are from Amazon from the results. So basically you could also read it as “AND NOT”.

Alternative: Use Search Folders, especially for repeated searches

Search Folder buttonAs you can imagine, there are some search queries which can get quite complex or long to type and you might long for that WYSIWYG editor again.

Luckily, there still is a way to get it by creating a Search Folder. The added benefit is that you can save your Search Query for reuse or create a Search Folder for the static part of your query and use the Search field for the variables like for instance the Date or From field.

Step 1: Enable the Query Builder
If you haven’t done so already, enable the Query Builder in Outlook by creating the following Registry key.

  1. Open the registry editor:
    Start-> type: regedit
  2. Browse to the following location in the registry
    HKEY_CURRENT_USER\Software\Microsoft\Office\<version>\Outlook\
  3. Choose: Edit-> New Key
  4. Name the key: QueryBuilder

Step 2: Create the Search Folder
Now you can create a Search Folder and use the Query Builder tab to construct your query.

  1. Create a new Search Folder
    • Outlook 2007
      File-> New-> Search Folder
    • Outlook 2010, Outlook 2013 and Outlook 2016
      tab Folder-> New Search Folder
    • Keyboard shortcut
      CTRL+SHIFT+P
  2. At the bottom of the dialog, select: Create a custom Search Folder.
  3. Press the Choose… button.
  4. Specify a name for your Search Folder.
  5. Use the Browse… button to select which folders to search in.
  6. Press the Criteria… button.
  7. Select the Query Builder tab to construct your Boolean Search Query.

Search Folder Criteria - Query Builder - AND and OR statements
Part of the Boolean Search Query can be saved as a Search Folder as well. To get the same results as from the example, all you’d have to do is press the “Has Attachments” button on the Search tab of the Ribbon.

Sperry Software
Use "BH93RF24" to get a discount when ordering!