跳到主要內容

如何在Google工作表中反轉vlookup函數?

在Google工作表中,我們可以應用Vlookup函數根據給定的條件查找並返回第一個和左一個匹配值。 但是,有時,您需要反轉Vlookup函數以獲取最後一個匹配值或左列中的值。 您如何在Google工作表中處理此工作?

反向Vlookup函數以公式查找最後匹配的值

反向Vlookup函數可使用公式從右至左列查找值


反向Vlookup函數以公式查找最後匹配的值

要vlookup並根據條件返回最後一個匹配值,請應用以下公式:

輸入以下公式: = INDEX(A:B,MAX(過濾器(ROW(A:A),A:A = D2)),2) 放入要返回結果的空白單元格,然後按 Enter 鍵,一次顯示最後一個匹配值,請參見屏幕截圖:

備註:在以上公式中, A:B 是您要從中查找數據的範圍, 答: 是包含您要vlookup的條件的列數據,並且 D2 是您要基於其返回匹配值的條件, 2 是要從中返回值的列號。


反向Vlookup函數可使用公式從右至左列查找值

有時,您需要從右向左進行vlookup,正常的vlookup函數將無法正常工作,這是一個簡單的公式可以為您提供幫助,請按以下步驟操作:

請輸入以下公式: =index(A1:A16,match(D2,B1:B16,0)) 放入要放入結果的空白單元格,然後按 Enter 鍵,將返回左列中的匹配值,如以下屏幕截圖所示:

備註:在以上公式中: A1:A16 是列範圍包含要返回的匹配值, D2 是具有條件的單元格, B1:B16 是包含要從中進行查找的條件的範圍。

最佳辦公生產力工具

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

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

kte選項卡201905


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

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (8)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How if we want to find the last non-empty matching value using this formula?
This comment was minimized by the moderator on the site
Hello, Ardi,To solve your problem, please apply the below formula:=ArrayFormula(MAX(IF($A$2:$A$13=D2,$B$2:$B$13,)))
Please try, hope it can help you!
This comment was minimized by the moderator on the site
For Reverse Vlookup function to find the last matching value with formula, is this possible between 2 sheets? Thank you
This comment was minimized by the moderator on the site
Hello, Rox,



To vlookup the last matching item between two sheets in Google sheets, please apply the following formula:

Note: Sheet3 is the sheet contains the original table data, and A2 is the cell in your current sheet that you want to get the result, please change them to your need.

=ArrayFormula(INDEX(Sheet3!A:B, MAX(filter(ROW(Sheet3!A:A), Sheet3!A:A=A2)),2))



Please try, hope it can help you!
This comment was minimized by the moderator on the site
bro it doesnt work...
This comment was minimized by the moderator on the site
Hello Georgius,Sorry to hear that. But I found an amazing formula which can really work. I noticed that only using Vlookup formula can't solve the problem. We need to combine the LOOKUP function with SORT function. 
Please see the two screenshots. In Sheet1, range B1:C8 is the original table data. In Sheet2, cell B2 (Apple) is the lookup value. Please copy the formula in a blank cell to get the result: =LOOKUP(B2, SORT(Sheet1!B1:B8), SORT(Sheet1!C1:C8,Sheet1!B1:B8,TRUE))It returns 88, the last matching value of B2 (Apple). Please have a try. Thanks!
Sincerely,Mandy
This comment was minimized by the moderator on the site
And is it possible to get the matching value before the last matching value? For ex., you have 200 matching values. Can you instantly get the 199th matching value? Thank you.
This comment was minimized by the moderator on the site
and is it possible to get the matching value before the last matching value? Ex. if you have 200 matching values. can you instantly get the 199th values? Thank you
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations