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.
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.
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.
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.
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
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!