简体   繁体   English

如果列B中的ID重复,如何在列C中计算“是”的次数

[英]How to count number of “Yes” in column C once only if ID in column B repeats

I need help counting Yes in column C, but only count it once if ID in column B repeats 我需要帮助在C列中计算是,但只有在B列中的ID重复时才计算一次

Sample of output. 输出样本。 for sample below count should be 6. 对于低于计数的样本应为6。

Here is dropbox file link. 这是dropbox文件链接。 Dropbox file link Dropbox文件链接

在此输入图像描述

I can do this already via if and else condition using formula, but I would like someone can come up with better way using single line formula. 我已经可以通过if和else条件使用公式来做到这一点,但我希望有人可以使用单行公式提出更好的方法。

Current solution in cell F2 细胞F2中的当前解决方案

=IF(B2<>B1,IF(C2="Yes","1",""),IF(B2=B1,IF(F1="1","",IF(B2=#REF!,"",""))))

in cell F3 and down 在单元格F3和向下

=IF(B3<>B2,IF(C3="Yes","1",""),IF(B3=B2,IF(F2="1","",IF(B3=B1,"",""))))

Then I just count all ones and get total 1. 然后我只计算所有的并得到总数1。

=countif(F2:F159,"1")

You can use a similar approach to my previous answer in your link, ie using cell refs in your dropbox example 您可以在链接中使用与我之前答案类似的方法,即在您的Dropbox示例中使用单元格引用

=SUM(IF(FREQUENCY(IF(I2:I14="Yes",H2:H14),H2:H14),1))

confirmed with CTRL+SHIFT+ENTER CTRL+SHIFT+ENTER

H2:H14 has to be numeric data H2:H14必须是数字数据

Generically, assuming Range 4 is numeric you can use this formula for up to 3 conditions 一般来说,假设范围4是数字,您可以将此公式用于最多3个条件

=SUM(IF(FREQUENCY(IF((Range1="x")*(Range2="y")*(Range3="z"),Range4),Range4),1))

conditions can be added or removed as required 可以根据需要添加或删除条件

把它放在D2中并向下拖动:

=IF(COUNTIFS(B$2:B2,B2,C$2:C2,"Yes")=1,1,"don't count")

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

相关问题 如果 B 列重复,检查 D 列的员工姓名是否重复。如果是,只计算一次 - If duplicates in column B, check if duplicates in employee names in column D. If yes, only count once 当 Y 在 B 列或 C 列中时,计算 A 列中 X 的数量 - Count number of X in Column A when Y is in either Column B or C 从K栏算出“是”,那么B栏的年份是2014年? - Count 'Yes' from column K where year is 2014 in column B? 是否有 excel 公式来计算当另一列中的值为 YES 时 ID 在列中出现的次数? - Is there a excel formula to count how many times an ID appears in a column when the value in another column is YES? 如何只计算一次唯一记录并基于该计数是或否 - How to only count unique record once and based on that count Yes or No 如何根据名称和ID在C列中计算“否”? - How to count “No” in column C base on Name & Id? 根据 B 列中的标准计算 D 列中有多少值大于 C 列中的值 - Count how many values in Column D are bigger than in Column C based on criteria in Column B 计算A列中的行数,该行数在工作表2的B列的列表中具有值 - Count number of rows in column A that have a value in a list in column B on worksheet 2 匹配A列和B列中的名称,然后计算C中的出现次数 - Match names in column A and B, then count occurrences in C 匹配数字&gt; = A列和&lt;B列返回C列 - Match a number >= column A and < column B Return column C #
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM