如何计算电子表格中的单元格配对 [英] How to count pairings of cells in spreadsheet

查看:112
本文介绍了如何计算电子表格中的单元格配对的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个包含两列数据的电子表格。例如:

  AB 
1 2
2 3
1 1
1 2
1 3
2 3
2 1

我可以计算每一对在电子表格中显示的总次数。在上面的例子中,1-2应该有3(1为2-1,2为1-2),2-3应该有2etc的计数

解决方案

请注意,对于 Excel版本> 2007 ,您可以使用新的公式 COUNTIFS



添加了正确的解决方案(得分 Chris Nielsen - 查看评论)

  = COUNTIFS($ A $ 1:$ A $ 12,A1,$ B $ 1:$ B $ 12,B1)+ COUNTIFS($ A $ 1:$ A $ 12,B1,$ B $ 1:$ B $ 12,A1)


Let's say I have a spreadsheet that has two columns of data. For example:

A    B
1    2
2    3
1    1
1    2
1    3
2    3
2    1 

How could I count the total number of times each pair appears in the spreadsheet. In the example above, 1-2 should have a count of 3 (1 for 2-1, 2 for 1-2), 2-3 should have a count of 2etc

解决方案

Note that for Excel versions >2007, you can use the new formula COUNTIFS:

[EDIT] Added the correct solution (credits to Chris Nielsen - see the comments)

=COUNTIFS($A$1:$A$12,A1,$B$1:$B$12,B1) + COUNTIFS($A$1:$A$12,B1,$B$1:$B$12,A1)

这篇关于如何计算电子表格中的单元格配对的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆