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))),"")
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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))))),"")
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,765
Members
449,049
Latest member
greyangel23

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