ExcelTip.com
ExcelTip.com
Account Icon Account Icon Account Icon
Google Exceltip.com
JOIN OUR NEWSLETTER
  and receive for joining:
Free eBook Learn More!
Free Excel ADD-IN
Free Weekly Excel Tip
4 e-books in cd-rom
F1 Formulas & Functions
F1 Formulas & Functions
F1 EXCEL
F1 eBook (Spanish)
F1 EXCEL
Financial Statements.xls
 

» Filtering a List into Unique Records Using the COUNTIF Formula
CATEGORY: Excel Filter
To filter a List into unique records using the COUNTIF formula:

1. Select cell B2, and insert the formula =IF(COUNTIF($A$2:A2,A2)1,1,0).
2. Copy the formula from cell B2 downwards.
3. From the Data menu, select Filter, AutoFilter.
4. Select cell B1 and press Alt+Down Arrow to open the filtering dropdown list or open it by clicking the dropdown arrow and then selecting 0.


Screenshot // Filtering a List into Unique Records Using the COUNTIF Formula

Filtering a List into Unique Records Using the COUNTIF Formula
Rate this tip
12 34 5
  RATING: 3.15
  VIEWS: 64170

READER COMMENTS (view all comments)


CountIF would not work
Gizmo wrote on December 31, 1969 19:00 EST
By following the instructions above, the "To filter a List into unique records using the COUNTIF formula:" would not work for me.
filter list using countif
Tarqwin wrote on December 31, 1969 19:00 EST
I had to alter the formula for it to work,
=IF(COUNTIF($A$2:$A$13,A2)=1,1,0)
where $A$2:$A$13 was the list,
I could have renamed it List1 and had this
=IF(COUNTIF(List1,A2)=1,1,0)
and again drag the formula down.
This formula does not work for UNIQUE records
jP_in_Calif wrote on December 31, 1969 19:00 EST
I make the assumption that this ExcelTip is an error on the part of the webmasters post.

Using this formula will only produce a value of '1' (in the cell of the formula) where there is only 1 instance of the element in th list. If there are multiple instances of the element in the list, the returned value is 0.


As stated in the example, the COUNTIF portion of the function will return the 'count' of the number of occurances of 'criteria' in 'list' i.e. A2 in range a2:a12.

The portion of the formula containing 'IF', (the equals 1,1,0) states that, if the result of COUNTIF is =1, then its 1 else it's 0 .
Formula Doesn't work and Screen Capture is Wrong
Christine wrote on December 31, 1969 19:00 EST
I couldn't get this formula to work, even with the changes suggested. Also, the screen capture doesn't appear to relate to this tip at all.
Formula Doesn't work and Screen Capture is Wrong
Tarqwin wrote on December 31, 1969 19:00 EST
That's right, the conditional format is to highlight the rows with the unique occurences in column A with this formula for all the cells in that row and then drag down.
=IF(COUNTIF(list1,$A2)=1,1,0) with formatting to suit
Filter for Unique and Multiple Occurences
Nick wrote on December 31, 1969 19:00 EST
Rather than give you only the first occurrence, this formula will search the entire column and show which data have unique entries, and which have multiple entries:

=IF(COUNTIF($A$2:$A$65536,A2)=1,"UNIQUE","MULTIPLE")

Then use Data-->Filter-->AutoFilter
Change in formula
Thangamani wrote on December 31, 1969 19:00 EST
This formula will be a better option.

=IF(COUNTIF($A:$A,A2)=1,"Unique","Multiple")



REGISTERED USERS - Click here to post comments


GUESTS (Click here to register)
Name
Comment Title
Comments

Finance and Accounting for Nonfinancial Managers

Personal Finance for Dummies

The Sweet Potato Queens' Big-Ass Cookbook and Financial Planner

Absolute Beginner's Guide to Microsoft Office Excel 2003

The Ernst & Young Business Plan Guide

How to Use Financial Statements: A Guide to Understanding the Numbers

RELATED MICROSOFT EXCEL TIPS


Convert PDF Files to Excel






Excel VBA books
Accounting books
Business Plans
MS Office books
Taxes books

VIEW ALL BOOKS


  Advertise With Us                               

Tips

Add-In in VBA | Applications - Word, Outlook in VBA | Array Formulas | Cells, Ranges, Rows, and Columns in VBA | Counting | Custom Functions | Custom Functions in VBA | Database Formulas | Database in VBA | Date & Time Formulas | Date & Time in VBA | Events in VBA | Excel 2003 | Excel Chart | Excel Consolidating | Excel Counting | Excel Custom Functions using VBA | Excel Customizing | Excel Data | Excel Dates | Excel Editing | Excel Files | Excel Filter | Excel Format | Excel Formula | Excel General | Excel Grouping and Outlining | Excel Importing Text Files | Excel Information | Excel Keyboard Shortcuts | Excel Loan Formulas | Excel Macros - VBA | Excel Pivot Tables | Excel Printing | Excel Range Name | Excel Security - Protection | Excel Sorting | Excel Style | Excel Subtotals | Excel Summing | Excel Text | Excel Time | Excel Tools | Excel Worksheet, Workbook | Files, Workbook, and Worksheets in VBA | Financial Formulas | Formating in VBA | General Topics in VBA | Import and Export in VBA | Information Formulas | Keyboard & Other Shortcuts in VBA | Keyboard Formula Shortcuts | Links between Worksheet and Workbooks | Links in VBA | Logical Formulas | Lookup Formulas | Mail - Send and Receive in VBA | Menus, Toolbars, Status bar in VBA | Modules, Class Modules in VBA | Other Q&A Formulas | Printing in VBA | Protecting in VBA | Summing | Text Formulas | User Forms, Input boxes in VBA | Using Loops | Working with Formulas |

Tips by Version

Microsoft Excel 97 | Microsoft Excel 2000 | Microsoft Excel 2002 | All Microsoft Excel Versions | New in Excel 2002 | New in Excel 2003 - Office 11

Website

Home | Tip of Hour | Recommended Tips | Most Viewed Tips | Tips by Version | Submit a Tip | My Tips
Microsoft Excel Tutorials | Excel Links | Write for Us | About Us | Search Results | Tip Archives | Excel Forum | Excel Forum Archives

Excel Book

Excel 97 Book | Excel 2000 Book | Excel 2002 Book | Excel XP Book | Book Store

Terms and Conditions of use
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Copyright © 2003 ExcelTip.com
Microsoft, Microsoft Excel is a U.S. registered trademark of Microsoft Corporation
Site Developed By: Varien