简体   繁体   English

计算多个列中给定条件的唯一出现次数

[英]Count unique occurrences of a given criteria across multiple columns

I have 3 columns that I need to count the number of unique occurrences of a particular value between the 3 columns and return the number of occurrences in a corresponding column. 我有3列,我需要计算3列之间特定值的唯一出现次数,并返回对应列中出现的次数。

Column A contains account #'s that will have the same # appear multiple times. 列A包含将多次出现相同编号的帐户#。 Column B is a rating # (1-3 with all #'s appearing multiple times for each account # in column A). B列是等级#(A列中每个帐户#的所有号码都出现#1-3)。 Column C is an account name that will always be the same for each account # (Column A). C列是一个帐户名称,每个帐户编号(A列)始终相同。 Column D needs to show the total number of defective account numbers (column A) per account name (column C). D列需要显示每个帐户名称(C列)的有缺陷的帐户总数(A列)。 An account # is defective if it had a rating of 3, no matter how many times the 3 appeared. 如果帐户#3的评分为3,则该帐户#有缺陷,无论该帐户出现3次。

I will need the data in column D for my pivot table. 我将需要数据透视表的D列中的数据。

Below is an array formula that I'm using now and it works sort of; 下面是我现在正在使用的数组公式,它在某种程度上起作用; however, it only returns the number of defective cases for an acct name on a row where the rating is 3. Otherwise, it returns a value of 1. If the acct # has a value of 3 on ANY row, I need the number of total defective acct #'s for the corresponding acct name to appear in column D. 但是,它只返回评级为3的行中acct名称的有缺陷案例数。否则,它返回值1。如果acct#在ANY行中的值为3,我需要相应帐户名称的总缺陷帐户编号出现在D列中。

{=SUM(IF(FREQUENCY(IF(E5=3,IF(R$5:R$300=R5,MATCH(A$5:A$300,A$5:A$300,MATCH(E$5:E$300,E$5:E$300,0)*0)),0),ROW(R$5:R$300)-ROW(R$5)+1),1))} {= SUM(IF(FREQUENCY(IF(E5 = 3,IF(R $ 5:R $ 300 = R5,MATCH(A $ 5:A $ 300,A $ 5:A $ 300,MATCH(E $ 5:E $ 300,E $ 5:E $ 300,0)* 0)),0),ROW(R $ 5:R $ 300)-ROW(R $ 5)+1),1))}

If you can, please try =COUNTIFS(B:B,3,A:A,A5) in D5 copied down to suit. 如果可以,请尝试将=COUNTIFS(B:B,3,A:A,A5)复制下来以适合您。 If not possible, please advise which software and version is relevant. 如果无法解决,请告知相关的软件和版本。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM