vba Excel如何查找1列中的值存在于另一列的值范围内
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18489148/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Excel how to find values in 1 column exist in the range of values in another
提问by user1254579
I have two columns- column A which extends upto 11027(values) and column I which extends to 42000(values).Both the columns contains some code details.
我有两列 - A 列扩展到 11027(值)和 I 列扩展到 42000(值)。两列都包含一些代码详细信息。
Something like this
像这样的东西
A B
q123 as124
as124 gh456
ff45 q123
dd1 dd2
xx2
xx3
xx4
and so on...
等等...
I want to find if the names in column A exists in column B or not.using excel
我想查找 A 列中的名称是否存在于 B 列中。使用 excel
回答by Mayou
This is what you need:
这是你需要的:
=NOT(ISERROR(MATCH(<cell in col A>,<column B>, 0))) ## pseudo code
For the first cell of A, this would be:
对于 A 的第一个单元格,这将是:
=NOT(ISERROR(MATCH(A2,$B:$B, 0)))
Enter formula (and drag down) as follows:
输入公式(并向下拖动)如下:
You will get:
你会得到:
回答by sma
Use the formula by tigeravatar:
使用tigeravatar的公式:
=COUNTIF($B$2:$B$5,A2)>0 – tigeravatar Aug 28 '13 at 14:50
=COUNTIF($B$2:$B$5,A2)>0 – Tigeravatar 2013 年 8 月 28 日 14:50
as conditional formatting. Highlight column A. Choose conditional formatting by forumula. Enter the formula (above) - this finds values in col B that are also in A. Choose a format (I like to use FILL and a bold color).
作为条件格式。突出显示 A 列。按论坛选择条件格式。输入公式(上面) - 这会在列 B 中找到也在 A 中的值。选择一种格式(我喜欢使用 FILL 和粗体颜色)。
To find all of those values, highlight col A. Data > Filter and choose Filter by color.
要查找所有这些值,请突出显示 col A. Data > Filter 并选择 Filter by color。