Counting the Results of a Formula Using Find and Replace

Written by Allen Wyatt (last updated June 12, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


2

Hank has a worksheet for each item his company manufactures, listing in columns, among other data, the estimated and actual costs for each component used in manufacturing the item. There could be anywhere from 600 to 3,000 rows for each worksheet. In column AL there is a calculated Total Variance for each row. In column AW Hank displays the word "Investigate" if the Total Variance is out of bounds. He needs to count the number of times the word "Investigate" appears in this column, but has not been successful using Find and Replace to do this.

If you are bound and determined to use Find and Replace to get your count, then you should follow these steps:

  1. Press Ctrl+F. Excel displays the Find tab of the Find and Replace dialog box.
  2. In the Find What box, type "Investigate" (without the quote marks).
  3. Using the Look In drop-down list, choose the Values option. (If you cannot see the Look In drop-down list, click the Options button.)
  4. Click Find All. Excel expands the Find and Replace dialog box downward to include a list of all cells found that contain the word "Investigate." At the bottom-left of the dialog box you can see a count of the number of matches found.

That being said, using Find and Replace may not be the best approach. You may get extraneous information in your results, such as an instance of the word "Investigate" that appears in a different cell than one in column AW. Instead, consider just using a simple formula:

=COUNTIF(AW:AW,"Investigate")

This formula, if placed in a column other than AW, will return the total count of cells displaying "Investigate" in column AW. If there may be other characters on either side of the word (such as spaces), then you should change the formula slightly to include encasing asterisks:

=COUNTIF(AW:AW,"*Investigate*")

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13871) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

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

Centering a Custom Paper Size on a Piece of Letter-Sized Paper

Sometimes getting your printed output to match your expectations can be a challenge. Such is the case when you want to ...

Discover More

Using AutoCorrect to Start Macros

As you are typing, AutoCorrect provides a "check" that what you are entering doesn't match some pre-defined error ...

Discover More

Omitting Page Numbers on Some Pages

Excel doesn't allow for as robust of headers and footers as Word does. Even so, there are some things you can do to ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Finding All Instances of a Value

Searching for information in an Excel worksheet generally goes very smoothly. There can be times, however, when the ...

Discover More

Making All Occurrences Bold

Want to make instances of a given word or phrase bold throughout a worksheet? Here's a way you can make the change quickly.

Discover More

Removing Cells Containing Specific Terms

Macros are great for processing large amounts of data quickly. This tip examines several ways you can remove specific ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, 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}] (all 7 characters, in the sequence shown) 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 6 - 0?

2021-06-18 14:53:02

Philip

Another way to perform this type of counting is by using a pivot table …


2021-06-14 07:06:22

Mike D.

@Allen
What I love about your site is no matter how much I know (or think I know) I always learn more. I contributed to this answer and it is heart warming to know I did so in a positive manner.
What I learned is that you can reference a column entirely with just the letter [AW:AW] no matter how many rows are used with this formula. I wonder how many other places this will work.

Thank you for expanding my mind and teaching this old dog new tricks.


This Site

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

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, 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.