Check if one value in one column is in another column

半腔热情 提交于 2019-12-10 19:57:34

问题


I want to check if the dates in the Date2 column match the dates in the Date1 column and which dates do not match. 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.

I tried:

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

However that only gives me #REF! back.

Is there probably another way to find out which dates do not match?

I appreciate your answer!


回答1:


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. If an exact match of date from column C is not found in column B, the error value #N/A is returned.

To get FOUND and NOT FOUND values you can use modification of this formula:

=IF(ISERROR(VLOOKUP(C2;$B$2:$B$3037;1;FALSE));"NOT FOUND";"FOUND")



回答2:


 =IFERROR(IF(VLOOKUP(B2,$A:$A,1,FALSE)=B2,"True"),"False")

This can work without specifying the exact length of column B




回答3:


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     


来源:https://stackoverflow.com/questions/21062763/check-if-one-value-in-one-column-is-in-another-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!