跳到主要內容

如何在Excel中從下到上vlookup匹配值?

通常,Vlookup函數可以幫助您從上到下查找數據,以從列表中獲取第一個匹配值。 但是,有時候,您需要從下到上進行vlookup提取最後一個對應的值。 您有什麼好主意可以在Excel中處理此任務嗎?

Vlookup使用公式從下到上的最後一個匹配值

Vlookup具有有用功能的自下而上的最後一個匹配值


Vlookup使用公式從下到上的最後一個匹配值

要從下到上vlookup匹配值,以下LOOKUP公式可以為您提供幫助,請執行以下操作:

請在要獲取結果的空白單元格中輸入以下公式:

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

然後將填充手柄向下拖動到要獲取結果的單元格,將立即返回最後一個對應的值,請參見屏幕截圖:

備註:在以上公式中: A2:A17 表示您要查找的列, D2 是您要返回其相對數據的條件,並且 B2:B17 是包含要返回的值的列表。


Vlookup具有有用功能的自下而上的最後一個匹配值

如果你有 Excel的Kutools,其 從下到上查找 功能,您也可以在不記住任何公式的情況下解決此任務。

提示:要應用此 從下到上查找 功能,首先,您應該下載 Excel的Kutools,然後快速輕鬆地應用該功能。

安裝後 Excel的Kutools,請這樣做:

1。 點擊 庫工具 > 超級查找 > 從下到上查找,請參見屏幕截圖:

2。 在 從下到上查找 對話框中,進行以下操作:

  • 從中選擇查找值單元格和輸出單元格 查找值和輸出範圍 部分;
  • 然後,從 數據范圍 部分。

3。 然後,點擊 OK 按鈕,所有最後匹配的值將立即返回,請參見屏幕截圖:

立即下載並免費試用Excel的Kutools!


更多相關文章:

  • 跨多個工作表的Vlookup值
  • 在excel中,我們可以輕鬆地應用vlookup函數在工作表的單個表中返回匹配值。 但是,您是否曾經考慮過如何在多個工作表中實現vlookup價值? 假設我有以下三個具有數據范圍的工作表,現在,我想根據這三個工作表中的條件來獲取相應值的一部分。
  • 在Excel中使用Vlookup精確匹配和近似匹配
  • 在Excel中,vlookup是最重要的功能之一,對我們而言,它是在表的最左列中搜索值並在範圍的同一行中返回該值。 但是,您是否在Excel中成功應用了vlookup函數? 本文,我將討論如何在Excel中使用vlookup函數。
  • Vlookup返回空白或特定值,而不是0或N / A
  • 通常,當您應用vlookup函數返回相應的值時,如果匹配的單元格為空,則將返回0,如果找不到匹配的值,則會顯示錯誤#N / A值,如下圖所示。 而不是顯示0或#N / A值,如何使其顯示空白單元格或其他特定的文本值?
  • Vlookup並串聯Excel中的多個對應值
  • 眾所周知,Excel中的Vlookup函數可以幫助我們查找值並在另一列中返回相應的數據,但是通常,只有在存在多個匹配數據時,它才能獲取第一個相對值。 在本文中,我將討論如何僅在一個單元格或垂直列表中進行vlookup並串聯多個對應的值。

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
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