简体   繁体   English

在Excel中的多个工作表上计算具有两个条件的文本的出现

[英]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等的出现次数我遇到了两个问题:

  1. The count is not split on the second argument, ei OK, error not run 计数未在第二个参数ei上拆分,确定,错误未运行
  2. I've only been able to count this on one sheet. 我只能在一张纸上数一下。 If I try to use a interval of sheets ('Test - 1:Test - 3' or using insert->name-Define) which is supposed to work according to my google hits it gives me #Value or #Error 如果我尝试使用一定间隔的工作表(“测试-1:测试-3”或使用insert-> name-Define),该间隔应该根据我的Google匹配结果工作,它会给我#Value或#Error

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.

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