简体   繁体   English

如何根据不同工作表中的2个条件计算单元格

[英]How to count the cells based on 2 conditions in different sheets

Am unable to count the number of occurrences based on 2 conditions in 2 different sheets using COUNTIFS. 我无法使用COUNTIFS根据2个不同工作表中的2个条件计算出现次数。 If i put the conditions in individual COUNTIF then its working. 如果我把条件放在单独的COUNTIF中那么它的工作。 But when i combine its not working. 但是,当我结合它不工作。

Formula: =COUNTIFS(A2:A7,Sheet2!A6,Sheet2!B2:B6,Sheet1!B1) 公式:= COUNTIFS(A2:A7,Sheet2!A6,Sheet2!B2:B6,Sheet1!B1)

What I expect is the value in cell B2 of sheet1 should display value "1" as there is only one record with B in Col2 and Critical in sheet 2 我期望的是sheet1的单元格B2中的值应该显示值“1”,因为只有一个记录在Col2中为B而在表2中为Critical

在此输入图像描述

Seems like you don't have your COUNTIFS criteria correct: 好像你没有正确的COUNTIFS标准:

在此输入图像描述

B2 : =COUNTIFS(Sheet2!$A$2:$A$6;Sheet1!A2;Sheet2!$B$2:$B$6;Sheet1!$B$1) B2=COUNTIFS(Sheet2!$A$2:$A$6;Sheet1!A2;Sheet2!$B$2:$B$6;Sheet1!$B$1)

C2 : =COUNTIFS(Sheet2!$A$2:$A$6;Sheet1!A2;Sheet2!$B$2:$B$6;Sheet1!$C$1) C2=COUNTIFS(Sheet2!$A$2:$A$6;Sheet1!A2;Sheet2!$B$2:$B$6;Sheet1!$C$1)

D2 : =COUNTIFS(Sheet2!$A$2:$A$6;Sheet1!A2;Sheet2!$B$2:$B$6;Sheet1!$D$1) D2=COUNTIFS(Sheet2!$A$2:$A$6;Sheet1!A2;Sheet2!$B$2:$B$6;Sheet1!$D$1)

And drag down. 然后拖下来。

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

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