Skip to main content

How to vlookup and return the last matching value in Excel?

If you have a list of items which are repeated many times, and now, you just want to know the last matching value with your specified data. For example, I have the following data range, there are duplicate product names in column A but different names in column C, and I want to return the last matching item Cheryl of the product Apple as following screenshot shown:

Vlookup the last matching value in Excel with formulas

Vlookup the last matching value in Excel with an easy feature


Vlookup the last matching value in Excel with formulas

To vlookup and return the certain value you need, the vlookup function will be first in your mind, but, with the vlookup function you just return the first matching value not the last. Here, I will talk about some other formulas to deal with this task.

Please enter this formula into your specified cell and then drag the fill handle down to the cells to get the last corresponding value as follows:

=LOOKUP(2,1/($A$2:$A$12=E2),$C$2:$C$12)

Notes:

1. If there is no data in the last matching cell, you will get a result of 0, but that is not your need, you want the last non-zero value, in this case, you should use the following formula: 

=LOOKUP(3,(1/($A$2:$A$12=E2))+(1/($C$2:$C$12<>"")),$C$2:$C$12)

2. In the above formulas, A2:A12 indicates the column that you are looking for, E2 is the value which you want to return its relative information and C2:C12 is the list that contains the value you want to return.

3. The value you are looking for is not case sensitive.


Vlookup the last matching value in Excel with an easy feature

If you have Kutools for Excel, with its LOOKUP from Bottom to Top feature, you can quickly solve this task no longer need to remembering any formula.

Tips:To apply this LOOKUP from Bottom to Top feature, firstly, you should download the Kutools for Excel, and then apply the feature quickly and easily.

After installing Kutools for Excel, please do as this:

1. Click Kutools > Super LOOKUP > LOOKUP from Bottom to Top, see screenshot:

2. In the LOOKUP from Bottom to Top dialog box, please do the following operations:

  • Select the lookup value cells and output cells from the Lookup values and Output Range section;
  • Then, specify the corresponding items from the Data range section.

3. Then, click OK button, all the last matching items have been returned at once, see screenshot:

Download and free trial Kutools for Excel Now!


More relative articles:

  • Vlookup Values Across Multiple Worksheets
  • In excel, we can easily apply the vlookup function to return the matching values in a single table of a worksheet. But, have you ever considered that how to vlookup value across multiple worksheet? Supposing I have the following three worksheets with range of data, and now, I want to get part of the corresponding values based on the criteria from these three worksheets.
  • Use Vlookup Exact And Approximate Match In Excel
  • In Excel, vlookup is one of the most important functions for us to search a value in the left-most column of the table and return the value in the same row of the range. But, do you apply the vlookup function successfully in Excel? This article, I will talk about how to use the vlookup function in Excel.
  • Vlookup To Return Blank Or Specific Value Instead Of 0 Or N/A
  • Normally, when you apply the vlookup function to return the corresponding value, if your matching cell is blank, it will return 0, and if your matching value is not found, you will get an error #N/A value as below screenshot shown. Instead of displaying the 0 or #N/A value, how can you make it show blank cell or other specific text value?
  • Vlookup And Concatenate Multiple Corresponding Values In Excel
  • As we all known, the Vlookup function in Excel can help us to lookup a value and return the corresponding data in another column, but in general, it can only get the first relative value if there are multiple matching data. In this article, I will talk about how to vlookup and concatenate multiple corresponding values in only one cell or a vertical list.

 

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

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...

Description


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!

 

Comments (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Proprio quello che stavo cercando, ma mi serviva per google spreadsheet e non su excel, l'ho provato su spreadsheet e non ha funzionato, qualcuno può aiutarmi? Come dovrebbe essere aggiustata la formula su spreadsheet per ottenere gli stessi risultati?
Grazie mille!
This comment was minimized by the moderator on the site
Hello, Yanhui,
If you want the formula work in Google Sheets, please apply the below fromula:
=ArrayFormula(LOOKUP(2,1/($A$2:$A$12=E2),$C$2:$C$12))
Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Hello,
I tryed to run on google sheet as you wrote, but I did not succeed. An idea?
This comment was minimized by the moderator on the site
Is there a way to easily / automatically create the product list table since I got a lot of product names ?

thank you.
This comment was minimized by the moderator on the site
Hi, Eko,
Sorry, I don't know what is in your product list, and what kind of product list to create, your problem is not clear. You can upload the attachment file or screenshot for a detailed explanation.
Thank you!
This comment was minimized by the moderator on the site
May I ask How to Find the Last Match in a Range with a Wildcard? Thank you very much.
This comment was minimized by the moderator on the site
Thank you for the formula its genius
I used your formula to come up with a fix for the blank cells without using CSE (Ctrl + Shift + Enter)
=LOOKUP(3,(1/(A2:A12=D2))+(1/(B2:B12<>"")),B2:B12)
This comment was minimized by the moderator on the site
In the above formula "=LOOKUP(9.99999999999999E+307,IF(A2:A12=D2,IF(ISNUMBER(B2:B12),B2:B12)))" why that "9.99999999999999E+307" has been taken in this?
This comment was minimized by the moderator on the site
Is there any way to combine this with TEXT values, which are in another sheet?
This comment was minimized by the moderator on the site
Thanks, this is brilliant
This comment was minimized by the moderator on the site
Oh. My God. How that. Impressed.. :)
This comment was minimized by the moderator on the site
I would also like to know why "2" and what "1/(A2:A9=D2)" is ?
This comment was minimized by the moderator on the site
Actually, I tried to understand and this is what I understand,

1. (A2:A9=D2) will return an array of true/false values depending on D2 value
2. The author divide one by the array of true/false to convert them to numbers
3. Then he lookup for 2 in the array which will return the last value. After I understood this, i was able to simplify the formula to the following which will give the same results with no conversions tricks

=LOOKUP(TRUE,(A2:A12=D2),B2:B12)
This comment was minimized by the moderator on the site
Thanks. The simplified formula works when data is present. But when Last Cell Value is missing, then result is 0.
This comment was minimized by the moderator on the site
Really impressed with this. However I don't understand what the 2 represents. Seems it's relevant to an array/vector formula. Online help no use of course. :-)
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations