COUNTIF Across Multiple Worksheets

excelbytes

Board Regular
Joined
Dec 11, 2014
Messages
249
Office Version
  1. 365
Platform
  1. Windows
I have 12 worksheets, each with 40 columns and 87 rows, In each cell in those worksheets can appear a "P". I want to create a formula on a separate worksheet that I can drag across and down that will count the number of times "P" appears in that cell across all 12 worksheets. I've names the list of 12 worksheets "Sheets". I've seen several examples using SUMPRODUCT, COUNTIF, & INDIRECT, but can't quite come up with the combination that I can drag across and down to count correctly.

Thanks in advance for your help.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try
Excel Formula:
=SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!RC",0),"P"))
 
Upvote 0
Solution
I get a #REF! error. Can you explain the RC? Also, I'm not clear on the second argument for the INDIRECT function of 0.
 
Upvote 0
Have you created the named range, 'Sheets' referring to a list of sheet names (as implied in your first post)? #REF! would suggest that either the named range 'Sheets' or 1 (or more) of the sheets listed in the range, 'Sheets' doesn't exist.

The second argument of indirect is either true or false, true is the default for normal references, false is for R1C1 references. RC is an R1C1 reference that gives the same cell address as the one holding the formula regardless of where it is on the sheet.
 
Upvote 0
A typo of a sheet name was the issue. Thanks for the explanation and the formula. Looks perfect.
 
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,093
Members
448,944
Latest member
SarahSomethingExcel100

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top