Count across multiple worksheets

CatRoberts

New Member
Joined
Mar 29, 2016
Messages
48
Hi there,

I've created a workbook and need to count the number of cells containing letters across the same row in the 12 worksheets.

My formula so far is:

=COUNTIFS(October!B5:AF5,"=V",November!B5:AF5,"=V")

I need to include all the months of the year (12 worksheets)

The formula will calculate correctly if I have only one month, i.e one worksheet, but when I add more it stops counting?

I'm very much a novice at excel, but what am I doing wrong? I thought i'd cracked it :(

Many thanks for your help

Cat
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
You need to use a COUNTIF for each worksheet instead of trying to squeeze every sheet into the same formula.

=COUNTIF(October!B5:AF5,"=V")+COUNTIF(November!B5:AF5,"=V")+etc....
 
Upvote 0
Create a range housing the names of the relevant sheets. Name that range SheetList via the Name Box.

Now invoke:

=SUMPRODUCT(COUNTIFS(INDIRECT("'"&SheetList&"'!B5:AF5"),"=V"))
 
Upvote 0
Hi, If i add one more criteria in below code, i got an error

=SUMPRODUCT(COUNTIFS(INDIRECT("'"&SheetList&"'!B5:AF5"),"=V"))*AND SUMPRODUCT(COUNTIFS(INDIRECT("'"&SheetList&"'!B5:AF5"),"=V"))
 
Upvote 0
Hi, If i add one more criteria in below code, i got an error

=SUMPRODUCT(COUNTIFS(INDIRECT("'"&SheetList&"'!B5:AF5"),"=V"))*AND SUMPRODUCT(COUNTIFS(INDIRECT("'"&SheetList&"'!B5:AF5"),"=V"))

You can’t have AND the way you did. By the way, what is your second condition?
 
Upvote 0
You can’t have AND the way you did. By the way, what is your second condition?

Sorry there was a mistake in my post:

Here is the correct one:

=SUMPRODUCT(COUNTIFS(INDIRECT("'"&SheetList&"'!B5:B55"),"=Vital Part"))*AND(SUMPRODUCT(COUNTIFS(INDIRECT("'"&SheetList&"'!B5:B55"),"=A")))

My condition is to count if Vital Part & A both matched,

If i use the above one it will count if " Vital Part & B " comes.

Thanks for the timely reply Aladin.
Thanks a lot.
 
Upvote 0
No... it doesn't work. It counts both vital part ,A and gives the count as 2.
 
Upvote 0

Forum statistics

Threads
1,223,970
Messages
6,175,707
Members
452,667
Latest member
vanessavalentino83

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