excel count unique combinations of columns

不想你离开。 提交于 2019-12-24 10:29:31

问题


I'm looking to build a formula that counts the number of specific combinations of columns. An example of what I'm looking at for data is similar to this.

Invoice   Account
A1415     1234
A1415     4567
B1415     1234
B1415     1234
B1415     4567
A1415     4567
C1415     1234

Out of this data I have 5 unique combinations from the columns. Can anyone help build a countif equation that looks at both columns together? I'm stumped on this one. Thanks!


回答1:


Array formula**, assuming data in A1:B7:

=SUM(IF(FREQUENCY(MATCH(A1:A7&"|"&B1:B7,A1:A7&"|"&B1:B7,0),ROW(A1:A7)-MIN(ROW(A1:A7))+1),1))

Regards

**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).



来源:https://stackoverflow.com/questions/28613134/excel-count-unique-combinations-of-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!