Skip to main content

How to vlookup matching value from bottom to top in Excel?

Author: Xiaoyang Last Modified: 2020-05-26

Normally, the Vlookup function can help you to find the data from top to bottom to get the first matching value from the list. But, sometimes, you need to vlookup from bottom to top to extract the last corresponding value. Do you have any good ideas to deal with this task in Excel?

Vlookup the last matching value from bottom to top with formula

Vlookup the last matching value from bottom to top with a useful feature


Vlookup the last matching value from bottom to top with formula

To vlookup matching value from bottom to top, the following LOOKUP formula can help you, please do as follows:

Please enter the below formula into a blank cell where you want to get the result:

=LOOKUP(2,1/($A$2:$A$17=D2),$B$2:$B$17)

Then drag the fill handle down to the cells that you want to get the results, the last corresponding values will be returned at once, see screenshot:

Note: In the above formula: A2:A17 indicates the column that you are looking for, D2 is the criteria which you want to return its relative data and B2:B17 is the list that contains the value you want to return.


Vlookup the last matching value from bottom to top with a useful feature

If you have Kutools for Excel, with its LOOKUP from Bottom to Top feature, you can also solve this task without 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, 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 values will be 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 (6)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
An update to this old post for anyone searching like I was ;-)

I was looking for the same functionality. Ended up using XLOOKUP which allows you to set a search mode for "last to first".

This was in Microsoft 365 Apps for Enterprise.

Hope it helps someone in the future.

Thanks
Rob
This comment was minimized by the moderator on the site
Excellent solution using the LOOKUP function, exactly what I was looking for!
I would like to add that with the hope it would help anyone who needed a similar solution to what I was looking for. If you want to return the row number of the matching value (not within the range, but rather within the entire column), you should use the following format by adding in the ROW function:=LOOKUP(2,1/($A$2:$A$17=D2),ROW($A$2:$A$17))
This comment was minimized by the moderator on the site
Hi All,
Are there any other ways to do this? While it works it is extremely resource intensive for large data sets.


Thanks,
This comment was minimized by the moderator on the site
The actual value of the "2" is irrelevant, it could be any number greater than 1 and less than infinity.

I believe the second term i.e. "1/($A$2:$A$19=D2)" creates an array by evaluating each cell in the range and if it is equal to D2 (a boolean test) it equates this to 1/TRUE, which as TRUE is 1 => 1. If it doesn't equal D2 it equates this to 1/FALSE, which as FALSE is 0 => infinity or Not a Number.

LOOKUP then takes over and searches for 2 in this array, which of course it can't find as they are either 1 or infinity.

If LOOKUP can't find a match it matches the highest number that is less than or equal to 2. Which is 1.

I'm not quite sure why this turns out to be the last occurrence of 1 though. Maybe LOOKUP (unlike VLOOKUP) always searches upwards?
This comment was minimized by the moderator on the site
I do not understand either why this picks the last occurrence of 1. It works, but WHY??!!

(Thanks, anyway!)
This comment was minimized by the moderator on the site
Hi Please can you explain this formula "=LOOKUP(2,1/($A$2:$A$19=D2),$B$2:$B$19)". It's worked for what I want to acheive very well, but I do not completely understand how. When typed into Excel, it shows that "2" is the lookup value, but we are actually looking up "D2" in this formula. Also what is "1/" doing on the lookup vector? Please could you break this formula down to explain how it works? Thanks
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations