# How to Lookup Top 5 Values with Duplicate Values Using INDEX-MATCH in Excel

In this article, we will learn how to lookup for multiple value with duplicate lookup values in Excel. So here is the scenario. I have 10 students. I prepared an exam. In that exam each student scored marks out of 100. Now in Excel, i want to write a formula that tells me top 5 scorer’s name. Apparently I can use the LARGE function, to get top values. And then VLOOKUP-CHOOSE or INDEX-MATCH function to trace down the names.

But the problem here is that it has clashing scores. And when you try to use INDEX-MATCH, it will return the first name found for same scores. It will not fetch the second name of duplicate score.

=INDEX(\$A\$2:\$A\$11,MATCH(LARGE(\$B\$2:\$B\$11,E2),\$B\$2:\$B\$11,0)) You can see that we have two top scorers, Kamal and Mridam who scored 54. But only kamal’s name is fetched on both positions.

This formula is fine, it just need a little help to identify each score uniquely. So we need a helping column here.

In C2, write this formula and copy through C11.

=RAND()+B2 The RAND function returns a random number between 1 and 0.

Now this column adds a random number to scores. Since the added number is between 1 and 0, there will be no significant change to actual score.

Now we can use this column to get our top 4 scorer’s names.

=INDEX(\$A\$2:\$A\$11,MATCH(LARGE(\$C\$2:\$C\$11,E2),\$C\$2:\$C\$11,0))

Here
LARGE(\$C\$2:\$C\$11,E2): LARGE function in Excel will return the nth Largest number from range \$C\$2:\$C\$11, which will be a unique value.
LARGE(\$C\$2:\$C\$11,E2),\$C\$2:\$C\$11,0): Match function will look for that max value in range \$C\$2:\$C\$11, and will return it’s index.
INDEX(\$A\$2:\$A\$11,MATCH(LARGE(\$C\$2:\$C\$11,E2),\$C\$2:\$C\$11,0)): Now INDEX function will look at that index in range \$A\$2:\$A\$11, and will return name at that Position.

You can hide this Helper column or make it invisible using colours.

Note that it works only for numeric values. It will fail for text values. If you want to VLOOKUP Multiple Values with duplicate lookup values then it will not work.

I hope this was helpful. Let me know if you have any specific requirement. Write it in the comments section below.

Related Articles:

How to VLOOKUP Multiple Values in Excel

How to use the INDEX and MATCH to Lookup Value in Excel

How to Lookup Value with Multiple Criteria in Excel

Popular Articles:

50 Excel Shortcuts to Increase Your Productivity

How to use the VLOOKUP Function in Excel

How to use the COUNTIF function in Excel

How to use the SUMIF Function in Excel

1. Hello,
I am in need of some assistance with the following data set:

A B C
0 1.096910013 0
0 1.397940009
4.08 1.698970004
4.95 2
8.09 2.301029996
8.09 2.602059991
8.09 2.903089987

I need Excel to return the max value associated with 0 (cell C2); cell C2 will change for each dataset so I need the formula to include that as the reference so it works every time. It's rare that future data sets will include multiple zeros, so I'd like to make the formula where it will still work when I don't have duplicates (i.e. still return the value associated with value in cell C2).
{"ft_lang_label":"__label__en","ft_lang_prob":0.85208505,"math_prob":0.90256745,"size":3200,"snap":"2021-43-2021-49","text_gpt3_token_len":811,"char_repetition_ratio":0.12140175,"word_repetition_ratio":0.0072202166,"special_character_ratio":0.263125,"punctuation_ratio":0.122535214,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97106117,"pos_list":[0,1,2,3,4,5,6,7,8,9,10],"im_url_duplicate_count":[null,4,null,4,null,4,null,4,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-16T03:57:37Z\",\"WARC-Record-ID\":\"<urn:uuid:1dd14d5f-9d36-4d4b-bebb-1e8bfc01e0a7>\",\"Content-Length\":\"90046\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ba4db1c7-e3f4-4f2b-a3f8-1864a8883099>\",\"WARC-Concurrent-To\":\"<urn:uuid:8351fc7a-e285-409a-a335-0eca99da71d8>\",\"WARC-IP-Address\":\"69.167.154.15\",\"WARC-Target-URI\":\"https://www.exceltip.com/lookup-formulas/vlookup-top-5-values-with-duplicate-values-using-index-match-in-excel.html\",\"WARC-Payload-Digest\":\"sha1:ZDTT5CWODSC3QIDDKIA6AAEQJ6E64KFQ\",\"WARC-Block-Digest\":\"sha1:HN6RMYMZG4SWD252SL76MGDKXSKUWFLL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323583408.93_warc_CC-MAIN-20211016013436-20211016043436-00206.warc.gz\"}"}