简体   繁体   English

Excel 公式 - 如果没有查找值,则 VLOOKUP 留空

[英]Excel Formula - VLOOKUP leave blank if no lookup value

I have an excel spreadsheet in which the VLOOKUP process I'm trying to do is getting more convoluted, but I'd like to try to see if this is possible.我有一个 excel 电子表格,其中我尝试执行的 VLOOKUP 过程变得更加复杂,但我想看看这是否可能。

I have the following formula:我有以下公式:

=IFERROR(VLOOKUP(A2,DataTable,4,FALSE),"Value Not Found")

This works perfectly for looking up a set of data by pasting the values into column A. This looks to see if the value is found in the table called "DataTable" and returns the value in the 4th index.这非常适合通过将值粘贴到 A 列来查找一组数据。这将查看是否在名为“DataTable”的表中找到该值并返回第 4 个索引中的值。

What I'm now trying to do is paste this formula all the way down the excel spreadsheet.我现在要做的是将这个公式一直粘贴到 excel 电子表格中。 However, this results in every cell to say "Value Not Found" even though there is no lookup value in column A. Is there a way to alter this formula to leave the cell blank if the respective cell in column A is blank?但是,即使 A 列中没有查找值,这也会导致每个单元格都显示“未找到值”。如果 A 列中的相应单元格为空白,是否有办法更改此公式以将单元格留空?

Thanks,谢谢,

use:利用:

=IF(A2="","",IFERROR(VLOOKUP(A2,DataTable,4,FALSE),"Value Not Found"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM