简体   繁体   English

检查一列中的一个值是否在另一列中

[英]Check if one value in one column is in another column

I want to check if the dates in the Date2 column match the dates in the Date1 column and which dates do not match. 我要检查,如果在该日期Date2 column在比赛的日期Date1 column和日期不匹配。 As you can see for the first 25 it matches, but in the end there are 10 rows empty which means that these values are missing. 正如你可以看到它匹配的前25个,但最后有10行为空,这意味着缺少这些值。

在此输入图像描述

I tried: 我试过了:

=VLOOKUP(C2:C3020;B2:C3037;C2;TRUE)

However that only gives me #REF! 但是那只给了我#REF! back. 背部。

Is there probably another way to find out which dates do not match? 是否有另一种方法可以找出哪些日期不匹配?

I appreciate your answer! 我感谢你的回答!

You should use following formula: 你应该使用以下公式:

=VLOOKUP(C2;$B$2:$B$3037;1;FALSE)

just write it in D2 cell and stretch it down until D3037 . 只需将其写入D2单元格并将其拉伸至D3037 If an exact match of date from column C is not found in column B , the error value #N/A is returned. 如果在列B未找到与列C完全匹配的日期,则返回错误值#N/A

To get FOUND and NOT FOUND values you can use modification of this formula: 要获取FOUNDNOT FOUND值,您可以使用此公式的修改:

=IF(ISERROR(VLOOKUP(C2;$B$2:$B$3037;1;FALSE));"NOT FOUND";"FOUND")
 =IFERROR(IF(VLOOKUP(B2,$A:$A,1,FALSE)=B2,"True"),"False")

这可以在不指定B列的确切长度的情况下工作

For instance, consider column values namely A and B

A   B
124 23
244 544
343 244
243 124
566 
677 

To check one value (124) in one column (B) is in another column (A)

=IF(ISNA(VLOOKUP(A2, $B$2:$B$5, 1, FALSE)),"",VLOOKUP(A2,  $B$2:$B$5, 1, FALSE))

A   B   C
124 23  124
244 544 244
343 244
243 124
566 
677     

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

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