Sumproduct Count Dates by Week Number- Indirect Sheet Name & Header

mdonovan890

New Member
Joined
Dec 22, 2016
Messages
24
I am working within Excel 2016 and I am currently using the following formula to count the number of dates equal to the week number. The formula uses indirect to obtain the sheet name in cell $J1 and counting the dates listed in column C.



The formula works well but I am wondering if there is a way to incorporate matching the header name?

Meaning, instead of counting the dates in column C, finding the column on the sheet that has “process date” in the header and then counting the dates.

Current Formula:

IF(J$1<>"",SUMPRODUCT(--(ISOWEEKNUM($C7)=ISOWEEKNUM(INDIRECT("'"&J$1&"'!$C$3:$C$8000"))),--(YEAR($C7)=YEAR(INDIRECT("'"&J$1&"'!$C$3:$C$8000")))),"")



My Attempt: K1 has the header name

=IF(J$1<>"",SUMPRODUCT(--(ISOWEEKNUM($C2)=ISOWEEKNUM(INDIRECT("'"&J$1&"'!$a$1:$z$8000"),MATCH(K1,INDIRECT("'"&$J$1&"'!$a$1:$z$1")),--(YEAR($C2)=YEAR(INDIRECT("'"&J$1&"'!$a$1:$z$8000")),MATCH(K1,INDIRECT("'"&$J$1&"'!$a$1:$z$1"),0),0))),"")
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
52,960
Office Version
  1. 365
Platform
  1. Windows
Maybe
Excel Formula:
=IF(J$1<>"",SUMPRODUCT(--(ISOWEEKNUM($C2)=ISOWEEKNUM(INDEX(INDIRECT("'"&J$1&"'!$a$1:$z$8000"),0,MATCH(K1,INDIRECT("'"&$J$1&"'!$a$1:$z$1"),0)))),--(YEAR($C2)=YEAR(INDEX(INDIRECT("'"&J$1&"'!$a$1:$z$8000"),0,MATCH(K1,INDIRECT("'"&$J$1&"'!$a$1:$z$1"),0))))),"")
 

Watch MrExcel Video

Forum statistics

Threads
1,122,588
Messages
5,597,042
Members
414,116
Latest member
sfullnet

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
Top