CountIF使用3个标准给出独特的vaules计数 [英] CountIF to give a count of the Unique vaules using 3 Criterias

查看:188
本文介绍了CountIF使用3个标准给出独特的vaules计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据位于三列

列A:城市

列B:产品代码

列C:公司名称

Column A: Cities
Column B: Product Code
Column C: Company name

现在,对于C列,一家公司可以拥有不同城市和产品代码的多行数据。

Now, For Column C, One company can have data in multiple rows, with different cities and Product codes.

需要以下内容:


说城市=纽约

产品代码= 100

The following is required:

Say City= New York
Product Code= 100

对于纽约市,代码100,计算C列中唯一的公司数量。

For City New York, Code 100, Count the unique number of companies in Column C.

总计数很容易得到,但是我对如何采取行动感到困惑

A Total row count is easy to get, but I am confused on how to take the unique count value of the Company Names after those filters.

谢谢。

推荐答案

有两种方法,一种使用FREQUENCY,另一种是使用SUM和COUNTIFS的数组公式。我喜欢后者:

There are two methods, one uses FREQUENCY and the other is an array formula with SUM and COUNTIFS. I prefer the latter:

=SUM(IF(($A$2:$A$7=D2)*($B$2:$B$7=D3),1/COUNTIFS($A$2:$A$7,D2,$B$2:$B$7,D3,$C$2:$C$7,$C$2:$C$7)))

作为数组公式,需要使用Ctrl-Shift-Enter输入,而不是退出编辑时输入模式。如果完成,Excel将围绕公式放入 {}

Being an array formula it needs to be entered with Ctrl-Shift-Enter instead of enter when exiting edit mode. If done correctly Excel will put {} around the formula.

这篇关于CountIF使用3个标准给出独特的vaules计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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