Countifs - multiple criteria over workbook - multiple pages

rebadanson

New Member
Joined
Dec 14, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Total newbie here - trying to pick this up as fast as I am capable so forgive if this question could be better worded.

1 workbook
12 tabs (April - Mar)
4 Officer codes (initials)
78 Application types.

I am trying to figure out the countifs formula for counting a combination of criteria, but across all pages in the worksheet.

I need the total countifs, for each of 78 application types - per officer... Application type = STATS!, M2 and Officer type = STATS!, O2 , but for the life of me I can't figure out the instruction for the criteria range to be selected as the whole workbook - I can only figure out one page at a time - Apr!, May! etc.

Is anyone able to help me see what I'm missing please?

Many thanks and please be gentle - this is all new to me at present.

Reba
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
i think you need to use sumproduct() and put the sheets into a table

=SUMPRODUCT(COUNTIFS(INDIRECT("'"&C1:C2&"'!a1:a40"),stats!M2,INDIRECT("'"&C1:C2&"'!b1:b40"),stats!m2))

but i dont know the range the data is in on each tab

this is just a sample

=SUMPRODUCT(COUNTIFS(INDIRECT("'"&C1:C3&"'!a1:a40"),stats!M2,INDIRECT("'"&C1:C3&"'!b1:b40"),stats!O2))

its on drop box for a short while

3d count - ETAF.xlsx
ABCDEFG
1jan
2feb3
3mar
4
5
Sheet1
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT(COUNTIFS(INDIRECT("'"&C1:C3&"'!a1:a40"),stats!M2,INDIRECT("'"&C1:C3&"'!b1:b40"),stats!O2))


3d count - ETAF.xlsx
KLMNOPQ
1
21a
3
4
stats


3d count - ETAF.xlsx
AB
1officer
21a
32
43
54
61a
72
83
94
101
112
123
134
jan


3d count - ETAF.xlsx
AB
1officer
21
31a
42
52
62
71
feb


 
Upvote 0
Thank you so much for taking the time to reply - I am grateful to you :)

I'll have another look using your example.

Reba
 
Upvote 0
you are welcome

with 365 version , you could also use vstack()
which is not volatile , as indirect is

A small number of the worksheet functions can be described as "volatile" functions.
This means that these functions constantly update when any changes are made to the worksheet.

I have added another simpler example for you - showing both vstack and indirect

count across multiple sheets - ETAF.xlsx
ABCDEFGH
1VstackIndirect
2A1sheet133
3A2sheet233
4A3sheet311
5A4sheet400
6A5sheet522
7A600
8A700
9A800
1036
11
Sheet1
Cell Formulas
RangeFormula
H2:H9H2=SUMPRODUCT(COUNTIF(INDIRECT("'"&$C$2:$C$6&"'!$A$2:$A$6"),B2))
E2:E10E2=SUMPRODUCT(--(VSTACK(Sheet2:Sheet6!$A$2:$A$10)=B2))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B9Expression=SUMPRODUCT(COUNTIF(INDIRECT("'"&$C$2:$C$6&"'!$A$2:$A$6"),B2))textNO


count across multiple sheets - ETAF.xlsx
A
1
2
3a1
4a1
5a1
6
Sheet2


count across multiple sheets - ETAF.xlsx
A
1
2a2
3a2
4
5
Sheet3


 
Last edited:
Upvote 0
You can get away with just SUM instead of SUMPRODUCT for the VSTACK option i believe
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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