跳到主要内容

如何在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中的最后一个匹配值

如果你有 Kutools for Excel,其 从下到上查找 功能,您可以快速解决此任务,而无需记住任何公式。

提示:申请这个 从下到上查找 功能,首先,您应该下载 Kutools for Excel,然后快速轻松地应用该功能。

安装后 Kutools for Excel,请这样做:

1。 点击 库工具 > 超级查找 > 从下到上查找,请参见屏幕截图:

2。 在 从下到上查找 对话框,请执行以下操作:

  • 从中选择查找值单元格和输出单元格 查找值和输出范围 部分;
  • 然后,从 数据范围 部分。

3。 然后,点击 OK 按钮,所有最后匹配的项目将立即返回,请参见屏幕截图:

立即下载并免费试用 Kutools for Excel!


更多相关文章:

  • 跨多个工作表的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 Tab 为 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