Filter unique distinct records using criteria
This blog post describes how to filter unique distinct records that meet a given condition in an Excel defined Table. This article shows you how to do it using an array formula: Filter unique distinct records with a condition
The difference with today's blog post is that you also can add more filters to your Excel Table, making the Excel Table a lot more useful and powerful.
Formula in cell E3:
Explaining formula in cell E3
The COUNTIFS function was introduced in Excel 2007 and it calculates the number of cells across multiple ranges that equals all given conditions.
The criteria_range1 and criteria1 is one pair, there must be as many pairs as there are columns in your data set.
COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)
Pair | criteria_range | criteria | Text |
1 | $B$3:B3 | B3 | Is value in cell B3 found in cell range $B$3:B3? |
2 | $C$3:C3 | C3 | Is value in cell C3 found in cell range $C$3:C3? |
3 | $D$3:D3 | D3 | Is value in cell D3 found in cell range $D$3:D3? |
Step 1 - The first argument pair
$B$3:B3 returns 40475 and B3 returns 40475.
The value in cell B3 is found once in cell range $B$3:B3.
Step 2 - The second argument pair
$C$3:C3 returns "AA" and C3 returns "AA".
The value in cell C3 is found once in cell range $C$3:C3.
Step 3 - The third argument pair
$D$3:D3 returns 1 and D3 returns 1.
The value in cell D3 is found once in cell range $D$3:D3.
Step 4 - All arguments
The COUNTIFS function returns 1 because all argument pairs return 1 meaning this record in row 3 is a unique distinct record, however, there might be duplicate records further down the list.
COUNTIFS($B$3:B3,B3,$C$3:C3,C3,$D$3:D3,D3)
becomes
COUNTIFS(40475,40475,"AA","AA",1,1)
and returns 1.
The image above shows that row 16, 17 and 19 contain duplicate records.
What are unique distinct rows/records?
Unique distinct rows are all rows but duplicate records are merged into one distinct record, see example in the picture below.
Table category
This article demonstrates different ways to reference an Excel defined Table in a drop-down list and Conditional Formatting. There are […]
This article demonstrates two formulas that extract distinct values from a filtered Excel Table, one formula for Excel 365 subscribers […]
This article demonstrates a formula that counts unique distinct values filtered from an Excel defined Table. Debra Dalgleish described in […]
This article demonstrates how to populate a drop down list with filtered values from an Excel defined Table. The animated […]
This article demonstrates how to filter records occurring in only one out of two Excel defined tables. It also shows […]
The image above demonstrates a conditional formatting formula applied to an Excel Table containing random data. The Excel Table has […]
This article describes a macro that hides specific columns automatically based on values in two given cells. I am also […]
The image above demonstrates a macro linked to a button. Press with left mouse button on the button and the […]
This article demonstrates how to filter duplicate records using a simple formula and an Excel defined table.
I will in this article demonstrate a macro that copies criteria from one Excel Table and applies them to another […]
In this tutorial, I am going to demonstrate how to filter an Excel define Table through a VBA macro. How it […]
This article explains how to filter a data set based on extremely many conditions in an Excel defined Table, in […]
This blog post demonstrates how to filter unique distinct values from an Excel table dynamically. When you change or add […]
Today I am going to demonstrate how amazing pivot tables are! Take a look at this time sheet. You can […]
I will in this article demonstrate three different techniques to sort a data set in Excel. The first method sorts […]
This article demonstrates how to insert and use a scroll bar (Form Control) in Excel. It allows the user to […]
An Excel table allows you to easily sort, filter and sum values in a data set where values are related.
This article demonstrates a macro that automatically applies a filter to an Excel defined Table based on the result from […]
The filter feature in Excel won't allow you to do OR logic between columns, however, you can if you allow […]
This article explains how to calculate the largest and smallest number based on a condition which is if the number […]
Unique distinct records category
Excel 2013 allows you to count unique distinct values in a pivot table, this article explains how to count unique […]
davidlim asks: re: Count records between two dates and a criterion based on the example, i was looking for 1 […]
This article demonstrates how to sort records in a data set based on their count meaning the formula counts each […]
Sean asks: If Tea and Coffee has Americano,it will only return Americano once and not twice. I am looking for a […]
Table of contents Filter unique distinct row records Filter unique distinct row records but not blanks Filter unique distinct row […]
The picture above shows an array formula in cell B9:C13 that extracts unique distinct records from two tables in cell […]
In a previous article "Automatically filter unique row records from multiple columns", I presented a solution to filter out unique […]
Functions in this article
More than 1300 Excel formulas
Excel formula categories
How to use Excel Tables
Excel categories
Leave a Reply
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.