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

## How to vlookup find the first, 2nd or nth match value in Excel?

Supposing you have two columns with Products and quantities as below screenshot shown. For quickly finding out the quantities of the first or second banana, what would you do? Here the vlookup function can help you deal with this problem. In this article, we will show you how to vlookup find the first, second or the nth match value with the Vlookup function in Excel.

Vlookup find the first, 2nd or nth match value in Excel with formula

Easily vlookup find the first match value in Excel with Kutools for Excel

#### Vlookup find the first, 2nd or nth match value in Excel

Please do as follows to find the first, 2nd or nth match value in Excel.

1. In cell D1, enter the criteria which you want to vlookup, here I enter Banana.

2. Here we will find the first match value of banana. Select a blank cell such as E2, copy and paste formula =INDEX(\$B\$2:\$B\$6,MATCH(TRUE,EXACT(\$D\$1,\$A\$2:\$A\$6),0)) into the Formula Bar, and then press Ctrl + Shift + Enter keys simultaneously. Note: In this formula, \$B\$2:\$B\$6 is the range of the matching values; \$A\$2:\$A\$6 is the range with all the criteria for vlookup; \$D\$1 is the cell containing the specified vlookup criteria.

Then you will get the first match value of banana in cell E2. With this formula, you can only get the first corresponding value based on your criteria.

To get any nth relative values, you can apply the following formula: =INDEX(\$B\$2:\$B\$6,SMALL(IF(\$D\$1=\$A\$2:\$A\$6,ROW(\$A\$2:\$A\$6)-ROW(\$A\$2)+1),1)) + Ctrl + Shift + Enter keys together, this formula will return the first matched value.

Notes:

1. To find the second match value, please change the above formula to =INDEX(\$B\$2:\$B\$6,SMALL(IF(\$D\$1=\$A\$2:\$A\$6,ROW(\$A\$2:\$A\$6)-ROW(\$A\$2)+1),2)), and then press Ctrl + Shift + Enter keys simultaneously. See screenshot: 2. The last number in the above formula means the nth match value of the vlookup criteria. If you change it to 3, it will get the third match value, and change to n, the nth match value will be found out.

#### Vlookup find the first match value in Excel with Kutools for Excel

You can easily find the first match value in Excel without remembering formulas with the Look for a value in list formula formula of Kutools for Excel.

Before applying Kutools for Excel, please download and install it firstly.

1. Select a cell for locating the first matching value (says cell E2), and then click Kutools > Formula Helper > Formula Helper. See screenshot: 3. In the Formula Helper dialog box, please configure as follows:

• 3.1 In the Choose a formula box, find and select Look for a value in list;
Tips: You can check the Filter box, enter certain word into the text box to filter the formula quickly.
• 3.2 In the Table_array box, select the table which contains the first matching value values.;
• 3.2 In the Lookup_value box, select the cell contains the criteria you will return the first value based on;
• 3.3 In the Column box, specify the column you will return the matched value from. Or you can enter the column number into the textbox directly as you need.
• 3.4 Click the OK button. See screenshot: Now the corresponding cell value will be auto-populated in cell C10 based on drop-down list selection. If you want to have a free trial ( 30-day) of this utility, please click to download it, and then go to apply the operation according above steps.

### 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. #### 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! No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi Can you provide the video for the above mentioned formula to fatch the 2nd ,3rd value of the data
This comment was minimized by the moderator on the site
Thank you so much!!!
This comment was minimized by the moderator on the site
What if the banana can be yellow or green, how can we use this formula to show the right quantity based on two values (instead of one just now)? Thanks for your help!
This comment was minimized by the moderator on the site
If the value result is #NUM! could you please show me the formula to add so it will return to ZERO result. Thank you
This comment was minimized by the moderator on the site
Just add IFERROR(your formula, the result you want to return), for example, the formula is =sum(A1:A6), then it would convert to =IFERROR(sum(A1:A6),""), it will return blank if the result is error like #NUM!.
This comment was minimized by the moderator on the site
Help me to find the maximum value of Bananaa using a formula . Ie to display 300
This comment was minimized by the moderator on the site
How to find the maximum value of Bananaa
This comment was minimized by the moderator on the site
=Sumproduct(((A2:A6)=D1)*((B2:B6)=Max(B2:B6))*(B2:B6))
This comment was minimized by the moderator on the site
[quote]=Sumproduct(((A2:A6)=D1)*((B2:B6)=Max(B2:B6))*(B2:B6))By Ferdhy[/quote] i appreciate your help FERDHY. i tried out the formula , but since max(B2:B6) is 500 (orange), the value i get is 0.
This comment was minimized by the moderator on the site
Hi, Just use this =SUMPRODUCT(MAX(((A2:A8)=D1)*(B2:B8))) once you change in D1 and put Banana, you should get 300 , if you put Orange, you will get 500. Ferdhy
This comment was minimized by the moderator on the site
You can also use:
=max(if(A2:A6=D1, B2:B6)) + Ctrl + Shift + Enter
This comment was minimized by the moderator on the site
How can I increase last number automatically when dragging the formula down: =INDEX(\$B\$2:\$B\$6,SMALL(IF(\$D\$1=\$A\$2:\$A\$6,ROW(\$A\$2:\$A\$6)-ROW(\$A\$2)+1),2)),
This comment was minimized by the moderator on the site
Dear Warthogb,

If you want to automatically get all matched values by dragging the formula down, please apply the following array formula:

=IFERROR(INDEX(\$B\$2:\$B\$7,SMALL(IF(\$D\$1=\$A\$2:\$A\$7,ROW(\$A\$2:\$A\$7)-ROW(\$A\$2)+1),1+(ROW(A1)-1))), "") + Ctrl + Shift + Enter
This comment was minimized by the moderator on the site
Crystal, Many many thanks, have only had a chance today 27/8/48 to see your help, will do formula later today :)
This comment was minimized by the moderator on the site
Hi,
I applied this formula but in my case I have numbers in place of the product name. When I drag down the formula to look for the next number in the list I get an error.

events volume odd events only volume
1 0.3 1 0.3
1 2.5 1 2.5
2 1.1 3 #NUM
2 0.5 3 #NUM
3 0
3 0.2
3 1
This comment was minimized by the moderator on the site
Dear Abby,
The drag down feature can only work for same vlookup values. But in your case, the vlookup values are different (1 and 3).
Please use this array formula: =IFERROR(INDEX(\$B\$2:\$B\$8,SMALL(IF(\$C\$4=\$A\$2:\$A\$8,ROW(\$A\$2:\$A\$8)-ROW(\$A\$2)+1),1+(ROW(A1)-1))), "") + Ctrol + Shift + Enter, and drag down the formula to get all matched values in the same vlookup value as below screenshot shown.
This comment was minimized by the moderator on the site
Awesome tutorial! Worked like a charm, even across multiple sheets in the same file! Many thanks!!
This comment was minimized by the moderator on the site
My current formula is {=IFERROR(INDEX(Sheet3!\$C\$2:\$C\$596,SMALL(IF(Sheet3!\$A\$2:\$A\$596=Sheet2!A19,ROW(Sheet3!\$A\$2:\$A\$596)-ROW(INDEX(Sheet3!\$A\$2:\$A\$596,1,1))+1),P19)),0)} But how would I apply this with multiple criteria, say two matches?
This comment was minimized by the moderator on the site
My problem is similar
ping me if you find solution
This comment was minimized by the moderator on the site
create an auxiliary column wich concatenates your criterias, then use the concatenate as the criteria!

Hope it works!
This comment was minimized by the moderator on the site
I have a little problem with this formula, it doesn't work exactly for my case:
=INDEX(\$B\$2:\$B\$6,SMALL(IF(\$D\$1=\$A\$2:\$A\$6,ROW(\$A\$2:\$A\$6)-ROW(\$A\$2)+1),1)) + Ctrl + Shift + Enter

what if the criteria I am looking for is not exactly the same each time (Banana), but rather it becomes part of a phrase (banana republic) and so on; what then? By changing the "n" number at the end of this formula, I get "#NUM!" response. I have a column of vocabulary that I want to search for their meaning in the second column, and by typing one word, I need to get all occurrence of that word in any phrase to be listed. Any help on this?
Thanks,
R.G.
This comment was minimized by the moderator on the site
Is it possible to use this formula to find if a number is between two numbers. Below is my formula. Trying to see if a listing with individuals and an amount is between to other set cells (Example: \$50,000 and \$74,999)

=ArrayFormula(INDEX('4 - Donors List'!\$B\$2:\$B\$1000,SMALL(IF('4 - Donors List'!\$F\$2:\$F\$1000>=D\$2,ROW('4 - Donors List'!\$F\$2:\$F\$1000)-ROW('4 - Donors List'!\$F\$2)+1),\$A6)))
This comment was minimized by the moderator on the site
Dear Ms/Mr,

I have a problem:
I knew a quantities of the product, I want to finding out the product name of the first or second match value of 200, what would you do?
Big Thanks !

Sim Van Narith
This comment was minimized by the moderator on the site
Good day,
Supposing the value of 200 locates in cell F2, please try this formula: =VLOOKUP(F2,IF({1,0},\$B\$2:\$B\$7,\$A\$2:\$A\$7),2,0).
Hope it can help. Thanks for your comment.
This comment was minimized by the moderator on the site
if a member was called on 1st October (October Data Set)as and it wasn’t revived, again the cce called him on 15th November(November Data Set). The member is revived on 16th November. While checking the revival using VLookup it makes YES to both the entries of October & November. How to avoid like it should show “YES” for the November entry actually when it was revived, and also leave the October entry as “NO”.
This comment was minimized by the moderator on the site
Is it possible to find an average of the non-unique data. Or would it be possible to have a list dropdown on the cell of the various values?
This comment was minimized by the moderator on the site
Good Day,
Sorry can't help you with this yet. Thank you for your comment.
This comment was minimized by the moderator on the site
And if you want the last, second last, nth last just add a counter (count the number of events already hapenned) to the end and subtract it by 0,1,n respectively.

Thank you so much! I was searching for this for a long time
This comment was minimized by the moderator on the site
Good Day,
Sorry can't help you with this yet. Thank you for your comment.
This comment was minimized by the moderator on the site
If the first or any of the other entry's for 'banana' column B was blank cell, of which I don't require this number, what changes are required to this formula to skip blank cell in column B.
This comment was minimized by the moderator on the site
Sorry I am using this formula
=INDEX(\$B\$2:\$B\$6,SMALL(IF(\$D\$1=\$A\$2:\$A\$6,ROW(\$A\$2:\$A\$6)-ROW(\$A\$2)+1),1))
This comment was minimized by the moderator on the site
SOLVED:
=SMALL(IF(A2:A7=D1,IF(B2:B7<>"",B2:B7)),1)

If 2nd or 3rd number required exchange ),1) to 2 or 3

This formula does not require index, as it directly looks at the value in Cell
This comment was minimized by the moderator on the site
Correction to previous formula:
The value was reading either the lesser or greater.

Updated formula
=INDEX(\$B\$2:\$B\$7,SMALL(IF(\$A2:\$A6=\$D\$1,IF(\$B\$2:\$B\$7<>"",ROW(\$A2:\$A6)-ROW(\$A2)+1)),1))

This skips blank cell and places value of non blank cell. Replace +1 with +2 or +3 for 2nd or 3rd value
This comment was minimized by the moderator on the site
Perfect explanation, thanks.
This comment was minimized by the moderator on the site
I have a scenario... How do I get last price of anything for reference... Example: Banana first price was 200... While purchasing for second time; I need to display 200 in my expected price cell and then if I buy that on the day at 220, I will put this value manually as 220... Whenever next time I will buy banana; I need to display 220 from the last purchase price
There are no comments posted here yet