比较/搜索 Excel 工作表
我必须有 Excel 表格。它们按照一个属性排序。现在我想比较这些表。问题是,我的表没有相同的值。
例如 表1 1 2 3 4 5 7 9
表 2 1 3 4 5 6 7 9
如果我尝试比较这些硬编码字段 (IF(A1=B1;x;y)),当我到达表 2 中的 3 时,我就会丢失一些行。那么我怎样才能在表中搜索这个数字并将其相应的行与其他行进行比较呢? 请不要使用 VB 脚本;)
感谢您的帮助
I have to Excel tables. They are sorted after one attribute. Now I want to compare these tables. The problem is, my tables don't have the same values.
e.g.
Table 1
1
2
3
4
5
7
9
table 2
1
3
4
5
6
7
9
if I try to compare these fields hardcoded (IF(A1=B1;x;y)) i have some missing rows as soon as I get to 3 in Table2. So how am I able to search the table for this number and compare its corresponding row to the other?
Please no VB-skript ;)
Thanks for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在这两个表中,您可以使用
=VLOOKUP()
到另一个表来检查是否存在。如果您正在处理大小经常变化的范围,则需要创建名称。示例:
=VLOOKUP(A1,Book2.xls!MyData,1,FALSE)
并复制下来=VLOOKUP(A1,Book1.xls!MyData,1 ,FALSE)
并在两本书中复制B 列中的 #N/A 表示另一个文件中不存在的键
您可以使用
=LOOKUP(lookup_value,lookup_vector,result_vector) 例如,在 Sheet1 中检索列
result_vector
(来自 Sheet2)中的值,其中lookup_vector
(来自 Sheet2)中的值与lookup_value
匹配(在表 1 中)。Sheet1 中的示例(查看 Sheet2-> Range [MyThirdColumn]:
=LOOKUP(A1;Book2.xls!MyData;Book2.xls!MyThirdColumn)
与上面的组合
=VLOOKUP( ....)
确定是否找到该键,您可以检索(并进一步比较)附加值:=if(NOT(ISNA(VLOOKUP(....))), LOOKUP(....),"不!")
希望能帮助您开发公式
In both tables you can use a
=VLOOKUP()
to the other table to check for existance. If you are working with ranges that frequently change in size, you would create names.Example:
=VLOOKUP(A1,Book2.xls!MyData,1,FALSE)
and copy down=VLOOKUP(A1,Book1.xls!MyData,1,FALSE)
and copy downin both books a #N/A in column B indicates a key that is not existing in the other file
You can use the
=LOOKUP(lookup_value,lookup_vector,result_vector)
e.g in Sheet1 to retrieve a value from columnresult_vector
(from Sheet2) where the value inlookup_vector
(from Sheet2) matches thelookup_value
(in Sheet1).example in Sheet1 (looking at Sheet2-> Range [MyThirdColumn]:
=LOOKUP(A1;Book2.xls!MyData;Book2.xls!MyThirdColumn)
In combination with the above
=VLOOKUP(....)
which determines if the key is found at all, you can retrieve (and further compare) attached values:=if(NOT(ISNA(VLOOKUP(....))),LOOKUP(....),"nope!")
Hope that helps you develop your formula
根据您使用的 Excel 版本,这里有一些提示:
Here are a few tips for you depending on the version of Excel you are using :