[英]Count occurance of text with 2 conditions over multiple worksheets in excel
I have a workbook in which I want to count the number of currence of a text and split this between different values. 我有一本工作簿,我想在其中计算文本的出现次数并将其拆分为不同的值。 I'll explain with pictures below:
我将在下面的图片中进行说明:
I have different worksheets with the following appearance: 我有以下外观的不同工作表:
The workbook contain a master sheet where I want to summarize the number of OK, errors and not run split between the values in the last column. 该工作簿包含一个母版纸,我想在其中汇总OK,错误而不是最后一列中的值之间的分隔。 My master sheets looks like this:
我的主表如下所示:
What i've done so far is to Count the number of occurance of LOE1, LOE2 etc with =SUMPRODUCT(COUNTIF(INDIRECT("'"&"Test - 1"&"'!J5:J99");J2))
but im experiancing two problems with this: 到目前为止,我所做的是使用
=SUMPRODUCT(COUNTIF(INDIRECT("'"&"Test - 1"&"'!J5:J99");J2))
计算LOE1,LOE2等的出现次数我遇到了两个问题:
I'm currently using excel 2003 我目前正在使用Excel 2003
Your formula should work OK with a list of sheetnames, eg list all the worksheet names somewhere on the worksheet - name that list Sheetlist and use this version 您的公式应与工作表名称列表一起正常工作,例如,在工作表上的某处列出所有工作表名称-列出工作表列表并使用此版本的名称
=SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheetlist&"'!J5:J99");$J2))
Note: no quotes around Sheetlist 注意:Sheetlist中没有引号
To accommodate the extra condition use COUNTIFS, eg with OK/Error etc. in column F 为了适应额外的条件,请使用COUNTIFS,例如F列中的OK / Error等。
=SUMPRODUCT(COUNTIFS(INDIRECT("'"&Sheetlist&"'!J5:J99");$J2;INDIRECT("'"&Sheetlist&"'!F5:F99");K$1))
COUNTIFS
requires Excel 2007 or later - in Excel 2003 you can use this version COUNTIFS
需要Excel 2007或更高版本-在Excel 2003中,您可以使用此版本
=SUM((T(INDIRECT("'"&Sheetlist&"'!J"&TRANSPOSE(ROW($5:$99))))=J$2)*(T(INDIRECT("'"&Sheetlist&"'!F"&TRANSPOSE(ROW($5:$99))))=K$1))
which is an "array formula" which needs to be confirmed with CTRL + SHIFT + ENTER 这是一个“数组公式”,需要使用CTRL + SHIFT + ENTER进行确认
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.