跳到主要内容

如何在Excel中使用vlookup返回空白或特定值而不是0或N / A?

通常,当您应用vlookup函数返回相应的值时,如果匹配的单元格为空,则将返回0,如果找不到匹配的值,则会显示错误#N / A值,如下图所示。 而不是显示0或#N / A值,如何使其显示空白单元格或其他特定的文本值?

匹配的单元格为空白:显示0 找不到匹配的值:显示N / A值

Vlookup返回空白或特定值而不是公式的0

Vlookup返回空白或特定值,而不是公式不适用

Vlookup通过强大的功能返回空白或特定值,而不是0或N / A


Vlookup返回空白或特定值而不是公式的0

请将此公式输入到您需要的空白单元格中:

=IF(LEN(VLOOKUP(D2,A2:B10,2,0))=0,"",VLOOKUP(D2,A2:B10,2,0))

然后按 输入 键,您将获得一个空白单元格而不是0,请参见屏幕截图:

:

1.在上式中 D2 是您要返回其相对值的条件, A2:B10 是您使用的数据范围,数字 2 指示返回匹配值的列。

2.如果要返回特定的文本而不是0值,则可以应用以下公式: = IF(LEN(VLOOKUP(D2,A2:B10,2,0))= 0,“具体文字“,VLOOKUP(D2,A2:B10,2,0))。


Vlookup在Excel中返回空白或特定值而不是0或N / A错误值

Kutools for Excel's 将0或#N / A替换为空白或特定值 如果vlookup结果为0或#N / A值,该实用程序可帮助您返回并显示空白单元格或特定值。 点击下载Kutools for Excel!

Kutools for Excel:拥有 300 多个方便的 Excel 插件,30 天内免费试用,无限制。 立即下载并免费试用!


Vlookup返回空白或特定值,而不是公式不适用

如果找不到您要查找的值,则用空白单元格或其他自定义值替换#N / A错误,可以使用以下公式:

=IFERROR(VLOOKUP(D2,A2:B10,2,FALSE),"")

然后,按 输入 获得所需结果的关键,请参见屏幕截图:

笔记:

1.在这个公式中 D2 是您要返回其相对值的条件, A2:B10 您使用的数据范围,数字 2 指示返回匹配值的列。

2.如果要返回特定的文本而不是#N / A值,则可以应用以下公式: = IFERROR(VLOOKUP(D2,A2:B10,2,FALSE),“具体文字“)。


Vlookup通过强大的功能返回空白或特定值,而不是0或N / A

如果你有 Kutools for Excel,其 将0或#N / A替换为空白或特定值 功能,您可以快速轻松地解决此任务。

提示:申请这个 将0或#N / A替换为空白或特定值 功能,首先,您应该下载 Kutools for Excel,然后快速轻松地应用该功能。

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

1。 点击 库工具 > 超级查询 > 将0或#N / A替换为空白或特定值,请参见屏幕截图:

2。 在 将0或#N / A替换为空白或特定值 对话框:

  • (1.)根据需要指定查找值和输出范围;
  • (2.)根据需要选择返回结果,可以选择 将0或#N / A值替换为空 选项或 将0或#N / A值替换为指定的值 选项;
  • (3.)选择数据范围以及相应的键和返回的列。

3。 然后,点击 OK 按钮,将显示您在第2步中指定的特定值,而不是0或#N / A错误值,请参见屏幕截图:

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


更多相关文章:

  • 跨多个工作表的Vlookup值
  • 在excel中,我们可以轻松地应用vlookup函数在工作表的单个表中返回匹配值。 但是,您是否曾经考虑过如何在多个工作表中实现vlookup价值? 假设我有以下三个具有数据范围的工作表,现在,我想根据这三个工作表中的条件来获取相应值的一部分。
  • Vlookup并返回两个值之间的匹配数据
  • 在Excel中,我们可以应用常规的Vlookup函数基于给定的数据获取相应的值。 但是,有时,我们想要vlookup并返回两个值之间的匹配值,您如何在Excel中处理此任务?
  • Vlookup并从下拉列表中返回多个值
  • 在Excel中,如何从下拉列表中进行vlookup并返回多个相应的值,这意味着当您从下拉列表中选择一项时,其所有相对值会立即显示,如以下屏幕截图所示。 本文,我将逐步介绍解决方案。
  • 跨多个工作表的Vlookup值以返回工作表名称
  • 假设我有多个工作表,每个工作表都包含一个名称列表,现在,我想在主工作表中查找名称,并返回名称所在的匹配工作表名称,如下面的屏幕快照所示。 您如何在Excel中解决此任务?
  • Vlookup并返回没有重复的多个值
  • 有时,您可能需要vlookup并将多个匹配的值一次返回到单个单元格中。 但是,如果在返回的单元格中填充了一些重复的值,那么在返回所有匹配值时如何忽略重复项,而仅保留唯一值,如下面的Excel截图所示?

最佳办公生产力工具

🤖 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 (27)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
can i amend formula =IF(VLOOKUP($C4,Sheet2!$F:$F,1,0),"1") to display result as "1" and #N/A as blank?
This comment was minimized by the moderator on the site
Hello, eggs
To splve your problem, please apply the below formula:

=IFNA(IF(LEN(INDEX($B$2:$B$19,MATCH(E2,$A$2:$A$19,0)))=0,"1",VLOOKUP(E2,IF({1,0},$A$2:$A$19,$B$2:$B$19),2,0)),"")


Please try, hope it can help you!
This comment was minimized by the moderator on the site
is it possible to get this formula to return result as 1 and #N/A as blank?
This comment was minimized by the moderator on the site
Hi, in my vlookup im getting zero and NA now i want to format the zero and NA to blank and also to have one formula that is going to cater all the cells instead of having 3difference formulas i want the formula i use to then know if its its NA OR Zero to automatic put a blank but still reveals' the exact answer
This comment was minimized by the moderator on the site
Hello, zodwa,
To return the blank results for both the 0 values and errors, you should apply the below formula:
=IFNA(IF(LEN(INDEX($B$2:$B$12,MATCH(D2,$A$2:$A$12,0)))=0,"",VLOOKUP(D2,IF({1,0},$A$2:$A$12,$B$2:$B$12),2,0)),"")


https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-vlookup-errors-1.png

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Very helpful, thanks
This comment was minimized by the moderator on the site
I think this is a good solution but is there a way around the problem that if I use it and then COUNTA() on the cells where the formula is created it counts those cells with "".
This comment was minimized by the moderator on the site
I am not a tech guru - I just want to add to my formula that if it does not find anything in the cell - it gives an accounting 0 that will be acknowledged in my total formula. =VLOOKUP(F4,Sponsorships1,2,FALSE)
This comment was minimized by the moderator on the site
for blank values the LEN function is converting true zero's from the lookup data to blank. Any ideas on how to bring true zeros across and only convert the blanks to blank?
This comment was minimized by the moderator on the site
Hi, Besty,
The above Len function just convert blanks to blank, and it keeps the real 0 when applying it. please try it again.
Or you can insert an attachment here to describe your problem.
Thank you!
This comment was minimized by the moderator on the site
Thank you, it worked!
This comment was minimized by the moderator on the site
Thanks sky yang - This is awesome!

I applied the formula you provided and I changed the cell references but now I'm getting #N/A instead of 0 or a negative symbol.
This comment was minimized by the moderator on the site
This is my formula. I can't get results to report a "-" instead of a zero. I don't want a zero I'd like accounting format for a zero. Please help.
=IF(ISNA(VLOOKUP($A13,'All Exp Posted'!$A$1:$B$100,2,FALSE)),"0",VLOOKUP($A13,'All Exp Posted'!$A$1:$B$100,2,FALSE))
This comment was minimized by the moderator on the site
all you need to do is set the cell setting to accounting and remove the " in the last part.

=IF(ISNA(VLOOKUP($A13,'All Exp Posted'!$A$1:$B$100,2,FALSE),0)

as you can see there is no quotation mark next to the zero, because adding the quotation marks sets the value as text.
This comment was minimized by the moderator on the site
Hi, laura,

If you want to get the result "- " instead of a zero, please apply the following formula:
=IF(LEN(VLOOKUP(E1,A2:B10,2,0))=0,"-",VLOOKUP(E1,A2:B10,2,0)).

Please change the cell references to your need.
Please try it, hode it can help you!

Thank you!
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