Sumproduct with countif in multiple worksheets

Derick63

Board Regular
Joined
Apr 6, 2018
Messages
76
Office Version
  1. 365
Hello All,
I have a Payroll workbook with 13 worksheets, January through December, and another sheet named "TD4" to display collected data in a form to print.
The 12 months all have the same layout and formulas.

I'm looking to count how many times $8.25 is entered in Column P for an employee's name in column C across the 12 sheets.


  • The TD4 sheet has the employee's name in cell C3.
  • All employee names appear in range C9:C109 in all 12 sheets. Each employee will appear four or five times in the column.
  • The $8.25 would be in range P9:P109 in all 12 sheets.
  • I have a named range (column) with the month names, January through December, called sheets.

I started using =COUNTIF(INDIRECT("'"&Sheets&"'!$C$9:$C$109"),$C$3) just to count the employee's name but I'm getting 4 as the product but I know there's 48 instances across all 12 sheets.

I also tried this but I know it's not right because I'm getting a #VALUE error =SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!$C$9:$C$109"),$C$3)+(INDIRECT("'"&Sheets&"'!$P$9:$P$109")="8.25"))

I hope I explained this issue properly......:confused:

Getting frustrated with this..... :confused:
Any help would be great. Thanks in advance.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I also tried =SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!$C$9:$C$109"), C3),COUNTIF(INDIRECT("'"&Sheets&"'!$C$9:$C$109"), 8.25)) and the result was 0.
There are 48 instances of 8.25 for the employee named in cell C3 on the TD4 worksheet.
 
Upvote 0
SOLVED!!!!! :)

I used COUNTIFS and reversed the array and criteria.

Corrected formula:
=SUMPRODUCT(COUNTIFS(INDIRECT("'"&Sheets&"'!$p$9:$p$109"),"8.25",INDIRECT("'"&Sheets&"'!$C$9:$C$109"),$C$3))
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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