Count occurrences in entire workbook - KING OF EXCEL


KINGEXCEL.INFO ( KING OF EXCEL ) Welcome KINGEXCEL.INFO - Nothing Is Unable ... About Excel Tricks, Learning VBA Programming, Dedicated Software, Accounting, Living Skills ...

Tuesday, January 7, 2020

Count occurrences in entire workbook

Count occurrences in entire workbook

Excel formula: Count occurrences in entire workbook
Generic formula 
To count matches in entire workbook, you can use a formula based on the COUNTIF and SUMPRODUCT functions. In the example shown, the formula in D5 is:
where "sheets" is the named range B8:B10.


This workbook has four worksheets. Three of the worksheets, "Sheet1", "Sheet2", and "Sheet3" contain 1000 random first names in a table that looks like this:
Sample data - 1000 random names in each sheet
Note: the range we are using in the formula, A1:Z10000, is arbitrary and should be adjusted to suit your data.

How this formula works

Working from the inside out, we first have this expression inside the INDIRECT function:
Because "sheets" is a named range that contains "Sheet1", "Sheet2", and "Sheet3", we get an array like this once the expression is evaluated:
Inside the array, we have three values, and each is a sheet name joined via concatenation to the range A1:Z10000. Notice that these are all text values.
Next, the INDIRECT function is used to convert each text value to a proper reference, which are supplied to the COUNTIF function as the range argument, along with the value in D5 for criteria.
Since we've given COUNTIF three separate ranges, we get back three results in array like this:
Each item is a a count for one sheet.
Finally, SUMPRODUCT is used to sum the array, and returns a result of 16.
#evba #etipfree #kingexcel
📤You download App installed directly on the latest phone here :

No comments:

Post a Comment