比较Excel中的2列 [英] Comparing 2 columns in excel
问题描述
我正在尝试比较2列的相似性.
A和B列中有字符串,当Col A的特定行与Col B中的对应行匹配时,我想显示.请注意Col A中的某些行可能为空.
I am trying to compare 2 columns for similarities.
There are strings in columns A and B and I want to display when a particular row of Col A matches the corresponding row in Col B. Note some of the rows in Col A might be empty.
所以,基本上这是=> if (A1==B1), C1 = TRUE
So, basically this => if (A1==B1), C1 = TRUE
这是我到目前为止尝试过的:
Here's what I've tried so far:
=IF(ISERROR(MATCH(A1,B1:B1,0)),"",A1)
=EXACT(A1,B1)
=IF(A1=B1,"True",B1)
这些都不给我匹配包含以下数据的列:
None of these give me a match for columns that contains the following data:
ColA
ColB
Xanthomonas oryzae
Xanthomonas oryzae
希望对此有所帮助.谢谢!
Would appreciate help with this. Thanks!
推荐答案
由于@Carl的答案对您不起作用,因此单元格内容不相等.检查是否有多余的空格或其他非打印字符.
Since @Carl's answer does not work for you, the cell contents are not equal. Check for excess spaces or other non printing characters.
尝试这些
=CLEAN(A1)=CLEAN(B1)
或
=TRIM(A1)=TRIM(B1)
或
=TRIM(CLEAN(A1))=TRIM(CLEAN(B1))
Trim
将删除前导和尾随空格,Clean
将删除0至31的ASCII字符.根据不同之处,您可能需要更详细的公式.
Trim
will remove leading and trailing spaces, Clean
will remove ascii characters 0 through 31. You may need a more elaborate formula depending on where the differences lie.
这篇关于比较Excel中的2列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!