Finding Documents Containing Multiple Occurrences of a Word

by Allen Wyatt
(last updated January 3, 2015)

8

Brian has a lot of Word documents. When displaying the Open dialog box or when using a regular folder window, he can search and display only documents that contain a specific word. He wonders, though, if there is a way to display only documents that contain at least two occurrences (or more) of a particular word. In other words, he wants to exclude the display of documents that either don't contain the word or that have only a single occurrence of the word.

This is actually quite easy to do—just use a wildcard character when setting up your search. For instance, let's say that you want to search for documents that contain at least two instances of the word "widget." You could use this as your search criteria:

widget*widget

Note that the asterisk is a wildcard; it matches any number of characters. Thus, you end up searching for "widget" followed by any number of characters and then another instance of "widget." If the document contains only a single occurrence of the word "widget," then this search string automatically excludes those documents.

In order for this approach to work, you'll need to make sure that the "Always search file names and contents" option is selected in the Search tab of Folder Options.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9957) applies to Microsoft Word 2007, 2010, and 2013.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Jumping to the Ends of Table Rows

Need to jump from one end of a table row to another? Word provides a couple of handy shortcuts that can make this type of ...

Discover More

Toggling Font Assignments in a Macro

If you need to quickly switch a text selection from one typeface to another, one way you can do it is with a macro. This tip ...

Discover More

Selecting a Word

There are a few editing tricks you can apply in Excel the same as you do in Word. Selecting a word from the text in a cell is ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Size Limit for Documents

Word can handle large documents, but how large is large? This tip examines the issue and provides some advice on how ...

Discover More

Document is Too Large for Word to Handle

Imagine trying to open a familiar document one day, only to find that Word gives you an error message that the file is too ...

Discover More

Opening Multiple Documents at Once

Word's Open dialog box provides many of the same file management functions as Windows Explorer does. One of the functions is ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four less than 6?

2015-03-10 06:18:12

Ken Endacott

In Windows Explorer click the Tools menu item and in the dropdown list click Folder options. Click the Search tab and under What to search select Always search file names and contents.


2015-03-08 12:50:12

Jill

Feeling stupid -but how do I check 'Always search file names and contents'?


2015-01-09 06:16:44

Ken Endacott

In testing I have found a strange thing with Word 2003 documents. If the document contains widget then searching for widget will find the document. If all occurrences of the word widget are then deleted and the file saved then searching for widget will still find the file. It is as if the word widget is still in the file but is not visible.

This also applies with .doc files that are saved as .docx but does not apply with files created as .docx.


2015-01-08 10:31:12

Brian

This isn't working for me. Search is still displaying documents that have only 1 instance of the word, even though I have searched for widget*widget. The documents are in Word 2003 format (.doc) and I am using Word 2010 and Windows 7.


2015-01-05 15:40:51

Peter Wezel

Hi Ken, Ric,
thanks a lot for your advice. Indeed that does the trick and gives me the output that I was looking for. The usual Windows search returns a list of all files that contain either of the terms. Now I am able to retrieve only those files that contain both terms.
I am already thinking about new ways to use this trick. :)


2015-01-05 10:50:56

Ric Glines

The search utility Agent Ransack offers several features that are an improvement on the inadequacies of Windows Explorer's search utility.

The vendor offers both free and pro versions, and you can set it up so that you can access the utility from the context menu that appears when you right click in any folder in Windows.

It offers several search modes, from a guided wizard for novices, to full support of regular expressions for more advanced users. I've been using the free version for many years.

Here's the vendor's site for this utility: http://www.mythicsoft.com/agentransack/


2015-01-05 01:23:12

Ken Endacott

Peter,
In Windows Explorer, select the folder that you want to search (or select C: for the whole drive). At the top right hand of Windows Explorer you will see an input box containing Search foldername. Enter your search text which will be something like 'Invoice*Acme Company' (without the quote marks). A list of files containing the search criteria in the name of the file or in the body of document will be given.

Important: make sure that 'Always search file names and contents' is checked in Tools/Folder options/Search otherwise only the file names will be searched.


2015-01-03 09:29:47

Peter

This sounds like something I always wanted to have, but was afraid to ask for. I would like to use this feature to search for documents containing a combination of two words, e.g. "Invoice" in combination with a vendor name. Unfortunately, I cannot figure out where I should enter the search term. There is the regular Search box at the bottom of the Start menu in Windows, but this does not accept the wild card (the * is treated like a space). Please advise.


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.