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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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,223,886
Messages
6,175,194
Members
452,616
Latest member
intern444

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