In Microsoft Excel, there are several suitable methods to find duplicate values with various functions. In this article, you’ll learn several handy methods with INDEX-MATCH to find matches or duplicate values in Excel with suitable examples and proper illustrations.
Download Practice Workbook
You can download the Excel workbook that we’ve used to prepare this article.
3 Formulas with INDEX-MATCH to Deal with Duplicate Values in Excel
Formula 1: Mark Duplicate Values with INDEX, MATCH, IF, and COUNTIF
Let’s get introduced to our dataset first. Here, I have placed some salespersons’ states and sales within 7 rows and 3 columns. Now we’ll find duplicate values by using the INDEX, MATCH, IF, and COUNTIF functions. If no duplicate is found then the formula will show “Original” and if there is any duplicate then it will show “Duplicate”. The INDEX function returns a value or the reference to a value from within a table or range. The MATCH function searches for a specified item in a range of cells and then returns the relative position of that item in the range. The IF function is used to check a condition whether it’s met or not, and then it returns one value if it’s true and another value if it’s false. And the COUNTIF function counts the number of cells in a range that meets a given criterion.
⏩ Activate Cell E5
⏩ Type the formula given below-
=IF(COUNTIF($C$5:C6,C5)>1,"Duplicate of "&INDEX($B$5:B6,MATCH(C5,$C$5:C6,0)),"Original")
⏩ Then just hit the ENTER button to get the output.
⏩ Now double-click the Fill Handle icon as shown in the image below to copy the formula for the other cells.
Finally, you will see that the duplicates are found.
💡 Formula Breakdown:
The MATCH function finds the first occurrence of a value in a stack of values and returns the relative row number where the value is found. So it returns as-
The INDEX formula returns a value from a specified row of a specified stack of cells. Like, INDEX(B1:B10,5) would return the 5th value in the range B1:B10. From our array it will return as-
The COUNTIF function will look at all the states so far and counts up how many times the current value has occurred. If Excel sees the current value for the first time, the formula returns 1. And as 1 is not greater than 1, so it will show-
➥ IF(COUNTIF($C$5:C6,C5)>1,”Duplicate of “&INDEX($B$5:B6,MATCH(C5,$C$5:C6,0)),”Original”)
Finally, the IF function will show “Original” for FALSE and Duplicates for TRUE. So it returns-
Read More: Multiple Criteria in Excel Using INDEX, MATCH, and COUNTIF Function
Formula 2: Match the Duplicate Values with INDEX, ROW, and SMALL
Here, we’ll find values for the nth duplicate by using the INDEX, ROW, and SMALL functions. The ROW function returns the row number for reference. And the SMALL function is used to return the nth smallest value from a given set of values.
⏩ In Cell C16 write the given formula-
Here we have defined array and reference names that will be helpful to use the formula-
Click here to learn how to define names in Excel.
⏩ Click the Enter button for the output.
⏩ To copy the formula now just use the Fill Handle tool.
⏬ Formula Breakdown:
The INDEX function will return the value according to its relative row number 1 and column number 1. That is-
Then the ROW function will find its original row number-
As the upcoming INDEX function works for row number of a particular array, not for Excel row number, that is why we have to give the INDEX function the row number by applying this formula. The output is-
Then the IF function will do the logic test for the value “Alaska”. If found then it will show the position number whether it will show FALSE and that will return as-
The SMALL function will show the lowest number among them which is-
Finally the INDEX function will extract the value according to the output of the SMALL function,that returns-
Read More: Index Match Multiple Criteria in Rows and Columns in Excel
- Excel INDEX MATCH to Return Multiple Values in One Cell
- Excel INDEX-MATCH Formula to Return Multiple Values Horizontally
- INDEX MATCH Multiple Criteria with Wildcard in Excel (A Complete Guide)
- [Fixed!] INDEX MATCH Not Returning Correct Value in Excel (5 Reasons)
- How to Match Multiple Criteria from Different Arrays in Excel
Formula 3: Extract Data Based on Duplicates in Two Columns with INDEX+MATCH
In our last method, we’ll extract data based on duplicates from a column. I’ll extract the sales values for the states of Florida and Alabama. For that, we’ll use the INDEX, and MATCH functions.
⏩ Write the formula given below in Cell C14–
⏩ Later, press the Enter button to get the result.
⏩ Finally, use the Fill Handle tool to copy the formula.
⏬ Formula Breakdown:
The MATCH function will find the relative position for the state “Florida” from the state column, which returns-
➥ INDEX(C5:D11, MATCH($B14,C5:C11,0),2)
Finally, the INDEX function will extract the sales value according to row number 4 and column number 2 relative to the array C5:D11. That will return as-
Read More: How to Use INDEX-MATCH Formula in Excel to Generate Multiple Results
I hope all of the methods described above will be good enough to use INDEX+MATCH with Duplicate Values in Excel. Feel free to ask any questions in the comment section and please give me your feedback. Visit our website Exceldemy.com to explore more.
- Examples with INDEX-MATCH Formula in Excel (8 Approaches)
- How to Use INDEX MATCH Instead of VLOOKUP in Excel (3 Ways)
- Index Function to Match and Return Multiple Values Vertically in Excel
- IF with INDEX-MATCH in Excel (3 Suitable Approaches)
- Excel INDEX MATCH with Multiple Criteria (4 Suitable Examples)
- How to Use INDEX and Match for Partial Match (2 Ways)
Hi, nice tutorial, but I am a begginer.
I would like to make excel table for ordinary tennis league, but if 2 teams are equal with same points than it should take into account their mutual match, so who won the match is higher ranking. So, I have 12 teams, namely:
After entering the results for each round, let Excel itself sort the Teams in the following order:
a) Team with most points is highest ranking.
b) If 2 teams with the same nr. of points, the head-to-head is then watched and whoever won is higher ranking. If the teams have not yet played each other or have result for draw, then skip to c).
c) If the teams are still the same, then they are judged by goal difference – higher difference is higher ranking.
d) If the teams are still the same, then see who received fewer goals – who received less goals is higher ranking..
e If the teams are still the same, then see who scored more goals – who scored more goals is higher ranking.
f) If the teams are still the same, then they occupy the same ranking place.
Here is link for demo file:
If you have any solution / formula, pls let me know
Hello Mat, thanks for your feedback. The problem you mentioned will need a complex formula. You will have to apply a formula like this:
I’m trying to do something similar but am having a difficult time applying. I hope you can help with the following:
I have a sheet with thousands of rows representing individual books. However, multiple individual items (books) can be a part of a single title. Each item has usage numbers. Also, each row has unique key for the catalog (catalog ID) and a unique key for the item (item barcode).
I’m looking for two formulas. One to count the number of items per title (according to catalog id). And another to sum the total item usage of all items on the same title.
I’ve included a sample sheet to help illustrate:
I’m looking for formulas to return the values seen in columns E and F.
Any help will be greatly appreciated!
You have created some great instructions! So I’m reaching out for assistance for, possibly, the second time.
If you have already seen a comment by me today, I apologize for the duplication. I posted something earlier but there was no indication that a comment had been submitted. Given your expertise, I thought it would be worth trying again!
I have a sheet with thousands of rows, each row with data about a single item (book). Each item has information such as number of uses and the catalog title to which that item is associated. The same catalog title can be associated with multiple items (think of a multi-volume set of books, all with the same title). Each item has a unique key (item barcode) and each title has a unique key (catalog id).
I am looking for two formulas to help examine usage. One formula will simply count the number of items associated with each title (according to catalog id), returning that value to each row. The other formula will sum the total number of uses of each item associated with that same title, returning that value to each row.
I’ve included an example sheet to demonstrate:
On the example sheet, I’m looking for formulas to return the values in columns E and F.
Any help will be most appreciated!
Thanks for your feedback.
To count the number of items associated with each title (according to to catalog id), use this formula: =COUNTIF($B$2:$B$27,B2)
And to sum the total number of uses of each item associated with that same title, use this formula: =SUMIF($B$2:$B$27,B2,$D$2:$D$27)
the duplicates in the first example seem wrong. The dups are being identified by states and Michigan is marked as a duplicate, but it is not. Alabama is a duplicate, but is tagged as original.
Thank you so much for letting us know. The formula has been edited. Thanks for your concern. Stay connected!
Author: ExcelDemy Team
i am preparing a result sheet
in which there are 4 different worksheets in excel with each semester marks of all students
in 5th worksheet i am calling the top 10 scorers from each semester
everything was fine, i used formula
=INDEX(‘Semester 2’!C10:C46,MATCH(LARGE(‘Semester 2′!L10:L46,4),’Semester 2’!L10:L46,0))
but issue arose when i saw 4 and 5 has both same names
however the names should be different
because 2 different students scored same marks
so this formula is calling 1st from both same scorers
how to handle this
else 1 to 3 and 6 to 10 are fine
since their scores were unique
so guide me how can i deal with students who secured same marks using such formula
Thank you for sharing your problem. I am replying on behalf of ExcelDemy. Assuming the student names are in Column A and the scores are in Column B, insert this formula to get the top 10 scorers with duplicate values.
If you want to get the names in another sheet, then just add the worksheet names in the formula (as shown below) and you will get your required output.
I hope this solution will help you. Otherwise, feel free to share your workbook with [email protected] and we will look into this deeply.