Question

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: enter image description here

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. My master sheets looks like this: enter image description here

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:

  1. The count is not split on the second argument, e.i OK, error not run
  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

I'm currently using excel 2003

Was it helpful?

Solution

Your formula should work OK with a list of sheetnames, e.g. 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

To accommodate the extra condition use COUNTIFS, e.g. with OK/Error etc. in column F

=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

=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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top