Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Filtering for Comments.

Filtering for Comments (Notes)

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


3

Robert has a worksheet that has comments included in various places. (These are the traditional comments, now called notes by Microsoft.) He wonders if it is possible to filter the rows in a data table so that only those rows that include comments in a particular column are displayed.

The filtering capabilities of Excel don't provide a way that you can automatically check for the presence of comments/notes, but there are a couple of ways you can approach a solution. One possible solution is to follow these general steps:

  1. Make a copy of the column that contains comments to be filtered.
  2. Select the duplicate column.
  3. Press F5 to display the Go To dialog box. (See Figure 1.)
  4. Figure 1. The Go To dialog box.

  5. Click Special. Excel displays the Go To Special dialog box. (See Figure 2.)
  6. Figure 2. The Go To Special dialog box.

  7. Click the Comments radio button (or the Notes radio button, if you are using the latest versions of Excel) and then press Enter. Only those cells containing comments are selected.
  8. Type any number, character, or phrase not already present in the column.
  9. Press Ctrl+Enter. All the selected cells (those with comments) should now contain what you typed in step 6.
  10. Use AutoFilter to display only those rows that contain whatever you typed in step 6.

If you prefer, you can create a user-defined function that will let you know if a particular cell has a comment associated with it. The following is a simple way to make such a determination:

Function CellHasComment(c As Range)
    Application.Volatile True
    CellHasComment = Not c.Comment Is Nothing
End Function

Now you can use a formula such as the following within a worksheet:

=CellHasComment(B2)

When the formula is executed, it returns either True or False, depending on whether cell B2 has a comment or not. You can then use Excel's filtering capabilities to display only those rows that have a True returned by the formula.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11232) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Filtering for Comments.

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

Adding a Break to Your Document

Want to modify the way your text flows between pages in a document? Word allows you to insert several types of breaks ...

Discover More

Sorting Single-Column Addresses

Got a document that contains a bunch of addresses? If you want to sort the addresses, then you are in for a surprise ...

Discover More

Reverse Numbered Lists

Adding numbered lists to your document is a snap; Word provides tools to add them immediately. What Word doesn't do is ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Formatting Text in Comment Boxes

Want to make your worksheet comments appear a certain way? It's easy to do using techniques you are already familiar with.

Discover More

Counting Comments in a Worksheet

Need to know how many comments are in a worksheet? You can figure out the count manually, or you can apply the handy ...

Discover More

Editing a Comment Close to Its Cell

Have you ever chosen to edit a comment, only to find that the comment is quite a ways from the cell with which it is ...

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 seven minus 7?

2023-08-11 16:15:42

J. Woolley

My Excel Toolbox includes the following dynamic array function to list a worksheet's auto filters (Data > Filter):
=ListAutoFilters([Target],[SkipHeader])
It returns three rows (filter range, head cell's value, filter criteria) for Target's worksheet with one column for each filter plus an optional header column. Target can be a cell or range on any worksheet in an open workbook; if omitted, the formula's cell is assumed. If SkipHeader is FALSE (default), a header will be returned in the first column; otherwise, there will be no header column. You can swap rows and columns like this:
=TRANSPOSE(ListAutoFilters(...))
My Excel Toolbox's SpillArray function (described in UseSpillArray.pdf) simulates a dynamic array in older versions of Excel.
See https://sites.google.com/view/MyExcelToolbox


2023-08-10 13:15:55

J. Woolley

Updating a suggestion by Willy Vanhaelen, you can define a conditional format rule to color cells that have a comment, then apply a filter based on cell color.
The following procedure assumes use of the HasComment function described in my previous comment below. If HasComment is located in another workbook or an Excel add-in file like MyToolbox.xlam, it cannot be directly referenced in a conditional format rule; therefore, a defined name (named range) is used instead:
1. Click Formulas > Defined Names > Define Name... and specify
    Name: CommentCell
    Scope: Workbook
    Comment: TRUE if this cell has a comment
    Refers to: =HasComment()
2. Select the range of cells with comments you want to filter.
3. Click Home > Styles > Conditional Formatting > New Rule... and specify
    Rule type: Use a formula...
    Where this formula is True: =CommentCell
    Format: Fill (specify a color)
Then each cell with a comment in the conditional format range will have the specified fill color. Now you can apply a filter based on that color to isolate table cells that have a comment.
Note: To initiate Filter by Color, there must be no blank cells below the filter header down to and including the colored comment cells.


2023-08-05 14:46:00

J. Woolley

The Tip addresses "rows that include comments in a particular column" and only "traditional comments" are considered.
My Excel Toolbox includes the following function returning TRUE if any cell in Target includes a comment:
=HasComment([Target],[Threaded])
Target is the range of cells to consider; default is the formula's cell.
If Threaded is TRUE, only new threaded Comments will be considered; default is FALSE for traditional unthreaded comments (Notes). To consider both for several columns in a row (like columns A:F in row 2):
=OR(HasComment(A2:F2,TRUE),HasComment(A2:F2))
If this formula is copied down several rows, it will return TRUE if any cell in the first 6 columns of each row has either type of comment.
See https://sites.google.com/view/MyExcelToolbox/


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.