Extract unique values based on one or more criteria in Excel

Extracting unique values based on criteria is a crucial task for data analysis and reporting. Supposing you have the data range on the left, and you want to list only the unique names in column B based on a specific criterion in column A. Whether you're working with older versions of Excel or leveraging the latest features in Excel 365/2021, this guide will show you how to extract unique values efficiently.
Extract unique values based on criteria in Excel
Extract unique values based on multiple criteria in Excel
Extract unique values from a list of cells with Kutools for Excel
Extract unique values based on criteria in Excel
• With array formula to list the unique values vertically
To solve this job, you can apply a complex array formula, please do as follows:
1. Enter the below formula into a blank cell where you want to list the extracting result, in this example, I will put it to cell E2, and then press Shift + Ctrl + Enter keys to get the first unique value.
=IFERROR(INDEX($B$2:$B$15, MATCH(0, IF($D$2=$A$2:$A$15, COUNTIF($E$1:$E1, $B$2:$B$15), ""), 0)),"")
2. Then, drag the fill handle down to the cells until blank cells are displayed, and now all the unique values based on the specific criterion have been listed, see screenshot:
• Extract and display unique values in a single cell using Kutools for Excel
Kutools for Excel provides a straightforward way to extract unique values and display them in a single cell, saving you time and effort when working with large datasets without remembering any formula.
After installing Kutools for Excel, please do as this:
Click "Kutools" > "Super Lookup" > "One-to-many Lookup(returns multiple results)" to open the dialog box. In the dialog box, please specify the operations as below:
- Select the "Output range" and "Lookup values" in the textboxes separately;
- Select the table range that you want to use;
- Specify the key column and return column from the "Key Column" and "Return Column" drop down separately;
- Finally, click the OK button.
Result:
All unique names based on the criteira are extracted in a single cell, see screenshot:
• With formula in Excel 365, Excel 2021 and later versions to list unique values vertically
With Excel 365 and Excel 2021, functions like UNIQUE and FILTER make extracting unique values more straightforward.
Enter the below formula into a blank cell, and then press Enter key to get all unique names vertically at once.
=UNIQUE(FILTER(B2:B15, A2:A15=D2))
- FILTER(B2:B15, A2:A15=D2):
- FILTER: Filters data from B2:B15.
- A2:A15=D2: Checks where values in A2:A15 match the value in D2. Only rows that meet this condition are included in the result.
- UNIQUE(...):
Ensures that only unique values from the filtered results are returned.
Extract unique values based on multiple criteria in Excel
• With array formula to list the unique values vertically
If you want to extract the unique values based on two conditions, here is another array formula can do you a favor, please do as this:
1. Enter the below formula into a blank cell where you want to list the unique values, in this example, I will put it to cell G2, and then press Shift + Ctrl + Enter keys to get the first unique value.
=IFERROR(INDEX($C$2:$C$15,MATCH(0,COUNTIF(G1:$G$1,$C$2:$C$15)+IF($A$2:$A$15<>$E$2,1,0)+IF($B$2:$B$15<>$F$2,1,0),0)),"")
2. Then, drag the fill handle down to the cells until blank cells are displayed, and now all the unique values based on the specific two conditions have been listed, see screenshot:
• With in Excel 365, Excel 2021 and later versions to list unique values vertically
For newer Excel versions, extracting unique values based on multiple criteria is much simpler.
Enter the below formula into a blank cell, and then press Enter key to get all unique names vertically at once.
=UNIQUE(FILTER(C2:C15, (A2:A15=E2) * (B2:B15=F2)))
- FILTER(C2:C15, (A2:A15=E2) * (B2:B15=F2)):
- FILTER: Filters data from C2:C15.
- (A2:A15=E2): Checks if the values in column A match the value in E2.
- (B2:B15=F2): Checks if the values in column B match the value in F2.
- *: Combines the two conditions with AND logic, meaning both conditions must be true for a row to be included.
- UNIQUE(...):
Removes duplicate values from the filtered results, ensuring the output contains only unique values.
Extract unique values from a list of cells with Kutools for Excel
Sometimes, you might want to extract unique values from a list of cells. Here, I recommend a useful tool, Kutools for Excel. Its "Extract cells with unique values (include the first duplicate)" utility allows you to quickly extract unique values.
1. Click a cell where you want to output the result. (Note: Do not select a cell in the first row.)
2. Then click "Kutools" > "Formula Helper" > "Formula Helper", see screenshot:
3. In the "Formulas Helper" dialog box, please do the following operations:
- Select "Text" option from the "Formula Type" drop down list;
- Then choose "Extract cells with unique values (include the first duplicate)" from the "Choose a fromula" list box;
- In the right "Arguments input" section, select a list of cells that you want to extract unique values.
4. Then click Ok button, the first result is displayed into the cell, then select the cell and drag the fill handle over to the cells that you want to list all the unique values until blank cells are shown, see screenshot:
Extracting unique values based on criteria in Excel is an essential task for efficient data analysis, and Excel provides multiple ways to achieve this based on your version and needs. By choosing the right method for your version of Excel and your specific requirements, you can efficiently extract unique values. If you're interested in exploring more Excel tips and tricks, our website offers thousands of tutorials.
More relative articles:
- Count The Number Of Unique And Distinct Values From A List
- Supposing, you have a long list of values with some duplicate items, now, you want to count the number of unique values (the values that appear in the list only once ) or distinct values (all different values in the list, it means unique values +1st duplicate values) in a column as left screenshot shown. This article, I will talk about how to deal with this job in Excel.
- Sum Unique Values Based On Criteria In Excel
- For example, I have a range of data which contains Name and Order columns, now, to sum only unique values in Order column based on the Name column as following screenshot shown. How to solve this task quickly and easily In Excel?
- Transpose Cells In One Column Based On Unique Values In Another Column
- Supposing, you have a range of data which contains two columns, now, you want to transpose cells in one column to horizontal rows based on unique values in another column to get the following result. Do you have any good ideas to solve this problem in Excel?
- Concatenate Unique Values In Excel
- If I have a long list of values which populated with some duplicate data, now, I want to find only the unique values and then concatenate them into a single cell. How could I deal with this problem quickly and easily in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.





- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in