Note: The other languages of the website are Google-translated. Back to English
English English

How to use VLOOKUP to create a unique list from table in Excel?

Here is a table containing class and the student names. However, some values in the list are duplicates. What I want is to have a list of unique names based on “Class A” as below screenshot shown. How can I handle this job by using VLOOKUP function in Excel?
doc vlookup unique list 1

Use VLOOUP to create a unique list from given table

Use VLOOUP to create a unique list from given table

Here is a somewhat long VLOOKUP formula that can deal with the job.

Select a cell below the criterion which you want to create the unique list based on, type this formula =IFERROR(INDEX(B$1:B$13, MATCH(0, COUNTIF(D$1:D1, IF(A$1:A$13=D$1,B$1:B$13,D$1)), 0)),""), press Shift + Ctrl + Enter keys to get the correct value, and then drag fill handle down until blank cell appears. See screenshot:
doc vlookup unique list 2

Note: In the formula, B$1:B$13 is the column you will lookup values from, A$1:A$13 is the column you will lookup value based on, D$1 is the cell with the specified criteria.

The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

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!
officetab bottom
Comments (4)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Why is this formula returning duplicate values?

=IFERROR(INDEX('PA Tool Components'!$D:$D, MATCH(0, COUNTIF('ONBM1 Boyce'!B$7, IF('PA Tool Components'!C:C='ONBM1 Boyce'!$B$7, 'PA Tool Components'!$D:$D, 'ONBM1 Boyce'!$B$7)), 0)), "")
This comment was minimized by the moderator on the site
Hi, Connor Willings, please try below formula, change Sheet17 to PA Tool Components, Sheet18 to ONBM1 Boyce.
=IFERROR(INDEX(Sheet17!D:D, MATCH(0, COUNTIF(Sheet18!B$7:B8, IF(Sheet17!C:C=Sheet18!B$7,Sheet17!D:D,Sheet18!B$7)), 0)),"")
please see the screenshot:
This comment was minimized by the moderator on the site
Hoe kan ik ervoor zorgen dat ik waardes die vaker voorkomen in de eerste lijst ook vaker terugkomen in de tweede lijst?
In het geval van het voorbeeld zoals met Rose gebeurt, die naam staat twee keer in de lijst voor Class A maar wordt maar 1 keer weergegeven in de rechter lijst.
This comment was minimized by the moderator on the site
Hi, Sander, sorry I do not understand Dutch, could you decribe your question in English? And if you could, please upload an attchment which list your data example for me to better understand what you need.
The methods provided in this tutorial is for getting the unique value based on class A or class B, if you want to get all values from class A, you need to search other methods.
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations