跳到主要內容

如何在Excel中進行vlookup並返回最後一個匹配值?

如果您有一個列表,這些列表可以重複很多次,而現在,您只想知道指定數據的最後一個匹配值。 例如,我具有以下數據范圍,A列中有重複的產品名稱,但C列中有不同的名稱,並且我想返回產品Apple的最後一個匹配項Cheryl,如以下屏幕截圖所示:

Vlookup Excel中具有公式的最後一個匹配值

Vlookup具有簡單功能的Excel中的最後一個匹配值


Vlookup Excel中具有公式的最後一個匹配值

要進行vlookup並返回所需的特定值,vlookup函數將是您的首要考慮因素,但是使用vlookup函數,您只需返回第一個匹配值,而不是最後一個匹配值。 在這裡,我將討論處理此任務的其他一些公式。

請將此公式輸入到您指定的單元格中,然後將填充手柄向下拖動到這些單元格中,以獲取最後對應的值,如下所示:

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

筆記:

1.如果最後一個匹配的單元格中沒有數據,您將得到結果0,但這不是您所需要的,您需要最後一個非零值,在這種情況下,您應該使用以下公式: 

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

2.在上述公式中, A2:A12 表示您要查找的列, E2 是您要返回其相對信息的值,並且 C2:C12 是包含要返回的值的列表。

3.您要查找的值不區分大小寫。


Vlookup具有簡單功能的Excel中的最後一個匹配值

如果你有 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 (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