2011-05-16 02:01:22 +0000 2011-05-16 02:01:22 +0000
← 软件用户

在Excel中比较两个字符串?

得分 61
Advertisement

我需要在excel中比较两个字符串,并确定它们是否相等,字符串在相邻的单元格中。例如,给定:

apple apple
water water
pear carrot
apple water
dog dog
pear carrot
Apple apple

,第三列的公式应该是:

true
true
false
false
true
false
false

。

Advertisement
Advertisement

答案 (2)

解决方案找到了!

得分 69
2011-05-16 08:04:21 +0000

使用内置的exact()函数:

=exact(A1, B1)

&001

如果字符串相同,则返回true。

Advertisement
得分 28
2011-05-16 02:26:23 +0000

如果你的第三列结果中的大小写不重要,=A1=B1.

这种比较(=A1=B1)与精确比较略有不同,因为不比较字符的大小写敏感度。精确函数也是比较字符的大小写。如果你需要检查大小写敏感度并指定自己的结果,请使用=IF(A1=B1,"true","false")。