我如何找到一列中的值而不是另一列中的值 [英] how do I find the values that are in one column but not in the other
问题描述
我在Google电子表格中有两列A和B.
I have two columns A and B in a google spreadsheet.
我想找到A列中的所有数字,但B列中没有.我该怎么做?
I want to find all the numbers that are in column A but not in B. How do I do that?
B可能与A列中的数字相同.
B could have the same numbers from column A.
因此,如果列A的数字为:1、2、3B的数字是3、4、5
So if column A has numbers: 1, 2, 3 and B has numbers 3, 4,5
我想获取A中但不是B中的所有数字:1、2
I want to get all the numbers that are in A but not in B: 1, 2
我该如何使用Google电子表格?
How do I do that using google spread sheet?
推荐答案
使用 MATCH
确定A列中的每一行是否都出现在B列中,然后将A列过滤为仅
Use MATCH
to determine whether each row in column A appears in column B, then filter column A to only the rows for which MATCH
returned #N/A
(i.e., that row's value in column A could not be found in column B):
=FILTER(A:A, ISNA(MATCH(A:A, B:B, 0)))
如果A包含重复项,并且您希望将结果序列减少为唯一值,则将整个内容包装在
If A contains duplicates and you want to reduce the result sequence to unique values, just wrap the whole thing in UNIQUE
:
=UNIQUE(FILTER(A:A, ISNA(MATCH(A:A, B:B, 0))))
这篇关于我如何找到一列中的值而不是另一列中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!