Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

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


Combine multiple worksheets/workbooks into one worksheet / workbook:

Combine multiple worksheets or workbooks into one single worksheet or workbook may be a huge task in your daily work. But, if you have Kutools for Excel, its powerful utility – Combine can help you quickly combine multiple worksheets, workbooks into one worksheet or workbook. Download the full feature 60-day free trail of Kutools for Excel now!

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download the free trial Now!

Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
  • Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
  • More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
  • Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
  • Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
  • Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
  • Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
  • More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.

arrow blue right bubble 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.


arrow blue right bubble 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.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days. 

1. Select a cell for locating the first matching value (says cell E2), and then click Kutools > Formula Helper > Look for a value in list. See screenshot:

doc vlookup return adjacent next cell 010

2. In the Formula Helper dialog box:

1). In the Table_array box, select the table which contains the first matching value values.

2). Specify cell (cell D1) which contains the criteria you need to lookup in the Look_value box.

3). Select the column with the first matching value in the Column box, and finally click the OK button.

Now the corresponding cell value will be auto-populated in cell C10 based on drop-down list selection.

Tip.If you want to have a free trial of this utility, please go to download the software freely first, and then go to apply the operation according above steps.


Office Tab - Tabbed Browsing, Editing, and Managing of Workbooks in Excel:

Office Tab brings the tabbed interface as seen in web browsers such as Google Chrome, Internet Explorer new versions and Firefox to Microsoft Excel. It will be a time-saving tool and irreplaceble in your work. See below demo:

Click for free trial of Office Tab!

Office Tab for Excel


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.
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
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Mark Rashleigh · 8 months ago
    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.
    • To post as a guest, your comment is unpublished.
      Mark Rashleigh · 8 months ago
      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))
      • To post as a guest, your comment is unpublished.
        Mark Rashleigh · 8 months ago
        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
        • To post as a guest, your comment is unpublished.
          Mark Rashleigh · 8 months ago
          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
  • To post as a guest, your comment is unpublished.
    JAntonio · 9 months ago
    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
    • To post as a guest, your comment is unpublished.
      crystal · 9 months ago
      Good Day,
      Sorry can't help you with this yet. Thank you for your comment.
  • To post as a guest, your comment is unpublished.
    Seth · 10 months ago
    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?
    • To post as a guest, your comment is unpublished.
      crystal · 9 months ago
      Good Day,
      Sorry can't help you with this yet. Thank you for your comment.
  • To post as a guest, your comment is unpublished.
    Santosh · 11 months ago
    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”.
  • To post as a guest, your comment is unpublished.
    Sim Van Narith · 1 years ago
    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
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      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.
  • To post as a guest, your comment is unpublished.
    Matt · 1 years ago
    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)))
  • To post as a guest, your comment is unpublished.
    R. G. · 1 years ago
    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.
  • To post as a guest, your comment is unpublished.
    Christina · 1 years ago
    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?
    • To post as a guest, your comment is unpublished.
      sunil · 11 months ago
      My problem is similar
      ping me if you find solution
      • To post as a guest, your comment is unpublished.
        Jones · 11 months ago
        create an auxiliary column wich concatenates your criterias, then use the concatenate as the criteria!

        Hope it works!
  • To post as a guest, your comment is unpublished.
    JB · 1 years ago
    Awesome tutorial! Worked like a charm, even across multiple sheets in the same file! Many thanks!!
  • To post as a guest, your comment is unpublished.
    Abby · 2 years ago
    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
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      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.
  • To post as a guest, your comment is unpublished.
    Warthogb · 2 years ago
    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)),
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      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
      • To post as a guest, your comment is unpublished.
        Warthogb · 2 years ago
        Crystal, Many many thanks, have only had a chance today 27/8/48 to see your help, will do formula later today :)
  • To post as a guest, your comment is unpublished.
    Ferdhy · 2 years ago
    =Sumproduct(((A2:A6)=D1)*((B2:B6)=Max(B2:B6))*(B2:B6))
    • To post as a guest, your comment is unpublished.
      Nithin · 2 years ago
      [quote name="Ferdhy"]=Sumproduct(((A2:A6)=D1)*((B2:B6)=Max(B2:B6))*(B2:B6))[/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.
      • To post as a guest, your comment is unpublished.
        Ferdhy · 2 years ago
        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
        • To post as a guest, your comment is unpublished.
          Rita · 2 years ago
          You can also use:
          =max(if(A2:A6=D1, B2:B6)) + Ctrl + Shift + Enter
  • To post as a guest, your comment is unpublished.
    Nithin · 2 years ago
    How to find the maximum value of Bananaa
  • To post as a guest, your comment is unpublished.
    Nithin · 2 years ago
    Help me to find the maximum value of Bananaa using a formula . Ie to display 300
  • To post as a guest, your comment is unpublished.
    Dynes · 2 years ago
    If the value result is #NUM! could you please show me the formula to add so it will return to ZERO result.

    Thank you
    • To post as a guest, your comment is unpublished.
      alan · 2 years ago
      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!.
  • To post as a guest, your comment is unpublished.
    MT · 3 years ago
    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!
  • To post as a guest, your comment is unpublished.
    Danish · 3 years ago
    Thank you so much!!!
  • To post as a guest, your comment is unpublished.
    EKTA SINGH · 3 years ago
    Hi

    Can you provide the video for the above mentioned formula to fatch the 2nd ,3rd value of the data