跳到主要内容

如何在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具有有用功能的自下而上的最后一个匹配值

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