简体   繁体   English

如何计算两行中有多少个单元格相同?

[英]How can I count how many cells are the same in both rows?

I'm currently struggling with something that seems to me like it should be quite simple.我目前正在努力解决在我看来应该很简单的事情。 I have the following two rows in a spreadsheet, say A and B from 1 to 5:我在电子表格中有以下两行,比如从 1 到 5 的 A 和 B:

Strategic, Input, Restorative, Learner, Individualization战略性、投入性、恢复性、学习者、个性化

Connectedness, Strategic, Intellection, Learner, Achiever连通性、战略性、智力、学习者、成就者

How can I count how many words are the same in both rows?如何计算两行中有多少相同的单词? The answer in the above case should be 2.上述情况的答案应该是 2。

This array formula should work:这个数组公式应该有效:

=SUM(IFERROR(MATCH(A:A;B:B;0)/MATCH(A:A;B:B;0);0))-1

When introducing the formula don't press enter.引入公式时不要按回车键。 You have to press Control+Shift+Enter.您必须按 Control+Shift+Enter。

It should be shown like this, with curly brackets:它应该像这样显示,带大括号: 在此处输入图片说明

You can do something like this in column C from row 1 to 5 and sum the result of the values.您可以在 C 列的第 1 行到第 5 行中执行类似操作,并对值的结果求和。

=ZÄHLENWENNS($B$1:$B$5;A1)    //German
=COUNTIF($B$1:$B$5,A1)        //English

在此处输入图片说明

You could use =SUMPRODUCT(--(COUNTIF(A1:A5,B1:B5)>0)) .您可以使用=SUMPRODUCT(--(COUNTIF(A1:A5,B1:B5)>0)) Sumproduct does not require ctrl+shift+enter also not in older Excel versions. Sumproduct 不需要ctrl+shift+enter在旧版 Excel 中也不需要。

PS This solution is not case sensitive. PS 此解决方案不区分大小写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Excel,我如何计算同名单元格旁边的值 - Excel, how can i count values ​next to cells with the same name 如何在 Excel 中找到相同行中具有匹配单元格的行以及这些行中彼此不匹配的单元格? - How can I find rows in Excel that have matching cells in the same rows as well as cells in these rows that do not match each other? 如何确定数据透视表生成多少行(Aspose Cells)? - How can I determine how many rows a PivotTable generates (Aspose Cells)? 如何比较不同行中的单元格,如果下部单元格不相同,则如何右插入? - How can I compare cells in different rows and insert-right if lower cell if not the same? 计算特定列表中没有多少个有价值的单元格 - Count how many cells of value are not in a specific list 计算有多少单元格超过其他单元格的值 - Count how many cells exceed other cells' value 如何计算交替行中的单元格对 - How to count pairs of cells in alternate rows 如何在Excel中连续计数单元格,但仅对相邻单元格计数一次 - How can I count cells in a row but only count adjacent cells once in Excel 如何使用“AND”和“OR”获取行数? - How can I get the count of rows using 'AND' and 'OR'? 如果不同的单元格是特定值,我怎么才能计算单元格? - How can I only count cells if a different cell is a specific value?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM