Countif looking at many sheets

J

Jock

How can I adapt the following to also look in the same range in sheet1!,
sheet2! and sheet3! as well as sheet 4! ?
=COUNTIF(sheet4!Z$4:Z$4000,"b")
 
T

Teethless mama

Remove the $ sign in the data range

=SUM(COUNTIF(INDIRECT("Sheet"&{1,2,3,4}&"!Z4:Z4000"),"b"))
 
T

Teethless mama

put all your sheet names in the cell:
A1: test 1
A2: test 2
A3: test 3
A4: test 4

"Mysheets" is defined name range A1:A4 (no quotes)

=SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!Z4:Z4000"),"b"))
 
J

Jock

That's it, thank you.
--
Traa Dy Liooar

Jock


Teethless mama said:
put all your sheet names in the cell:
A1: test 1
A2: test 2
A3: test 3
A4: test 4

"Mysheets" is defined name range A1:A4 (no quotes)

=SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!Z4:Z4000"),"b"))
 
T

T. Valko

look in the same range in sheet1!, sheet2!
and sheet3! as well as sheet 4!

If you only have a "few" sheets...

=COUNTIF(Sheet1!Z$4:Z$4000,"b")+COUNTIF(Sheet2!Z$4:Z$4000,"b")+COUNTIF(Sheet3!Z$4:Z$4000,"b")+COUNTIF(Sheet4!Z$4:Z$4000,"b")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top